Merge branch 'vanilla-libeio'
[platform/upstream/nodejs.git] / deps / libeio / eio.h
index bcbb579..1d597e1 100644 (file)
@@ -47,6 +47,15 @@ extern "C" {
 #include <stddef.h>
 #include <sys/types.h>
 
+#ifdef __OpenBSD__
+# include <inttypes.h>
+#endif
+
+#ifdef _WIN32
+# define uid_t int
+# define gid_t int
+#endif
+
 typedef struct eio_req    eio_req;
 typedef struct eio_dirent eio_dirent;
 
@@ -57,7 +66,11 @@ typedef int (*eio_cb)(eio_req *req);
 #endif
 
 #ifndef EIO_STRUCT_STAT
-# define EIO_STRUCT_STAT struct stat
+# ifdef _WIN32
+#   define EIO_STRUCT_STAT struct _stati64
+# else
+#   define EIO_STRUCT_STAT struct stat
+# endif
 #endif
 
 #ifndef EIO_STRUCT_STATVFS
@@ -327,6 +340,14 @@ void eio_destroy (eio_req *req);
 
 ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count);
 
+/*****************************************************************************/
+/* export these so node_file can use these function instead of pread/write */
+
+#if !HAVE_PREADWRITE
+ssize_t eio__pread (int fd, void *buf, size_t count, off_t offset);
+ssize_t eio__pwrite (int fd, void *buf, size_t count, off_t offset);
+#endif
+
 #ifdef __cplusplus
 }
 #endif