OS/2: more missing definitions.
[p5sagit/p5-mst-13.2.git] / os2 / os2ish.h
index d1c45ad..a60e573 100644 (file)
@@ -357,6 +357,8 @@ void *emx_realloc (void *, size_t);
 
 #include <stdlib.h>    /* before the following definitions */
 #include <unistd.h>    /* before the following definitions */
+#include <fcntl.h>
+#include <sys/stat.h>
 
 #define chdir  _chdir2
 #define getcwd _getcwd2
@@ -370,6 +372,24 @@ void *emx_realloc (void *, size_t);
         ? (--FILE_ptr(fp), ++FILE_cnt(fp), (int)c) : ungetc(c,fp))
 #endif
 
+#define PERLIO_IS_BINMODE_FD(fd) _PERLIO_IS_BINMODE_FD(fd)
+
+#ifdef __GNUG__
+# define HAS_BOOL 
+#endif
+#ifndef HAS_BOOL
+# define bool char
+# define HAS_BOOL 1
+#endif
+
+static inline bool
+_PERLIO_IS_BINMODE_FD(int fd)
+{
+    int *pflags = _fd_flags(fd);
+
+    return pflags && (*pflags) & O_BINARY;
+}
+
 /* ctermid is missing from emx0.9d */
 char *ctermid(char *s);