XEmacs 21.2.28 "Hermes".
[chise/xemacs-chise.git.1] / src / sysfile.h
index 3f4a694..932a503 100644 (file)
@@ -20,6 +20,9 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not really in FSF. */
 
+#ifndef INCLUDED_sysfile_h_
+#define INCLUDED_sysfile_h_
+
 #include <errno.h>
 
 #ifndef WINDOWSNT
@@ -203,10 +206,6 @@ Boston, MA 02111-1307, USA.  */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
-#if !defined (USG)  && !defined (WINDOWSNT)
-# define HAVE_FSYNC
-#endif
-
 #ifndef MAXPATHLEN
 /* in 4.1, param.h fails to define this. */
 #define MAXPATHLEN 1024
@@ -244,7 +243,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
@@ -255,7 +254,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
@@ -380,6 +379,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
@@ -470,3 +481,5 @@ int sys_execvp (CONST char *, char * CONST *);
 #if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE)
 # define sys_execvp execvp
 #endif
+
+#endif /* INCLUDED_sysfile_h_ */