#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
#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. */
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