XEmacs 21.2.24 "Hecate".
[chise/xemacs-chise.git.1] / src / sysfile.h
index 1a61127..cc8f2de 100644 (file)
@@ -55,6 +55,12 @@ Boston, MA 02111-1307, USA.  */
 #include <direct.h>
 #endif
 
+#ifndef        STDERR_FILENO
+#define        STDIN_FILENO    0
+#define        STDOUT_FILENO   1
+#define        STDERR_FILENO   2
+#endif
+
 #ifndef O_RDONLY
 #define O_RDONLY 0
 #endif
@@ -116,6 +122,14 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 
+#ifndef O_NONBLOCK
+#ifdef O_NDELAY
+#define O_NONBLOCK O_NDELAY
+#else
+#define O_NONBLOCK 04000
+#endif
+#endif
+
 /* if system does not have symbolic links, it does not have lstat.
    In that case, use ordinary stat instead.  */
 
@@ -230,7 +244,7 @@ Boston, MA 02111-1307, USA.  */
    Other encapsulations are declared in the appropriate sys*.h file. */
 
 #ifdef ENCAPSULATE_READ
-int sys_read (int, void *, size_t);
+ssize_t sys_read (int, void *, size_t);
 #endif
 #if defined (ENCAPSULATE_READ) && !defined (DONT_ENCAPSULATE)
 # undef read
@@ -241,7 +255,7 @@ int sys_read (int, void *, size_t);
 #endif
 
 #ifdef ENCAPSULATE_WRITE
-int sys_write (int, CONST void *, size_t);
+ssize_t sys_write (int, CONST void *, size_t);
 #endif
 #if defined (ENCAPSULATE_WRITE) && !defined (DONT_ENCAPSULATE)
 # undef write
@@ -366,6 +380,18 @@ int sys_readlink (CONST char *path, char *buf, size_t bufsiz);
 # define sys_readlink readlink
 #endif
 
+#ifdef ENCAPSULATE_FSTAT
+int sys_fstat (int fd, struct stat *buf);
+#endif
+#if defined (ENCAPSULATE_FSTAT) && !defined (DONT_ENCAPSULATE)
+# undef fstat
+/* Need to use arguments to avoid messing with struct stat */
+# define fstat(fd, buf) sys_fstat (fd, buf)
+#endif
+#if !defined (ENCAPSULATE_FSTAT) && defined (DONT_ENCAPSULATE)
+# define sys_fstat fstat
+#endif
+
 #ifdef ENCAPSULATE_STAT
 int sys_stat (CONST char *path, struct stat *buf);
 #endif