#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
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
#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
# 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