summaryrefslogtreecommitdiff
path: root/build/vs2008/unistd.h
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-09-08 21:52:54 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-09-08 21:52:54 +0900
commit295c0af040ee0c94b603d7965658dd63524117a7 (patch)
tree537aca5c5c1e32e4579ba8bf0fbdfd92f328e204 /build/vs2008/unistd.h
parente3c3b2b8eb7042f3fda8ab96fc5c98003284449b (diff)
downloadgmime-295c0af040ee0c94b603d7965658dd63524117a7.tar.gz
gmime-295c0af040ee0c94b603d7965658dd63524117a7.tar.bz2
gmime-295c0af040ee0c94b603d7965658dd63524117a7.zip
Diffstat (limited to 'build/vs2008/unistd.h')
-rw-r--r--build/vs2008/unistd.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/build/vs2008/unistd.h b/build/vs2008/unistd.h
new file mode 100644
index 0000000..2b7d1ac
--- /dev/null
+++ b/build/vs2008/unistd.h
@@ -0,0 +1,21 @@
+/**
+ * unistd.h: Emulation of some standard UNIX APIs
+ **/
+
+#include <process.h>
+#include <io.h>
+
+/* Map the Windows equivalents to the POSIX function names */
+#define open(path,flags,mode) _open(path,flags,mode)
+#define close(fd) _close(fd)
+#define read(fd,buf,n) _read(fd,buf,n)
+#define write(fd,buf,n) _write(fd,buf,n)
+#define lseek(fd,offset,whence) _lseek(fd,offset,whence)
+#define fdopen(fd,mode) _fdopen(fd,mode)
+#define unlink(path) _unlink(path)
+#define dup(fd) _dup(fd)
+#define getpid() _getpid()
+
+/* Implement some useful sys/stat.h macros that Windows doesn't seem to have */
+#define S_ISDIR(mode) ((mode) & _S_IFDIR)
+#define S_ISREG(mode) ((mode) & _S_IFREG)