Moved here from touch.c, with one change: define EISDIR to -1, not 0.
extern int errno;
#endif
-/* Some systems don't define ENOSYS. */
+/* Some systems don't define the following symbols. */
#ifndef ENOSYS
# define ENOSYS (-1)
#endif
#ifndef ENOTSUP
# define ENOTSUP (-1)
#endif
+#ifndef EISDIR
+# define EISDIR (-1)
+#endif
#include <stdbool.h>
# define O_TEXT _O_TEXT
#endif
+#if !defined O_NDELAY
+# define O_NDELAY 0
+#endif
+
+#if !defined O_NONBLOCK
+# define O_NONBLOCK O_NDELAY
+#endif
+
+#if !defined O_NOCTTY
+# define O_NOCTTY 0
+#endif
+
#ifdef __BEOS__
/* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */
# undef O_BINARY