--- libeio/eio.c 2011/07/14 18:30:10 1.86 +++ libeio/eio.c 2011/07/14 19:31:43 1.88 @@ -100,9 +100,11 @@ #define PAGESIZE 4096 /* GetSystemInfo? */ - #define stat(path,buf) _stati64 (path,buf) + #ifdef EIO_STRUCT_STATI64 + #define stat(path,buf) _stati64 (path,buf) + #define fstat(fd,buf) _fstati64 (path,buf) + #endif #define lstat(path,buf) stat (path,buf) - #define fstat(fd,buf) _fstati64 (path,buf) #define fsync(fd) (FlushFileBuffers (EIO_FD_TO_WIN32_HANDLE (fd)) ? 0 : EIO_ERRNO (EBADF, -1)) #define mkdir(path,mode) _mkdir (path) #define link(old,neu) (CreateHardLink (neu, old, 0) ? 0 : EIO_ERRNO (ENOENT, -1)) @@ -878,10 +880,10 @@ # define pread eio__pread # define pwrite eio__pwrite -static ssize_t +static eio_ssize_t eio__pread (int fd, void *buf, size_t count, off_t offset) { - ssize_t res; + eio_ssize_t res; off_t ooffset; X_LOCK (preadwritelock); @@ -894,10 +896,10 @@ return res; } -static ssize_t +static eio_ssize_t eio__pwrite (int fd, void *buf, size_t count, off_t offset) { - ssize_t res; + eio_ssize_t res; off_t ooffset; X_LOCK (preadwritelock); @@ -996,7 +998,7 @@ # undef readahead # define readahead(fd,offset,count) eio__readahead (fd, offset, count, self) -static ssize_t +static eio_ssize_t eio__readahead (int fd, off_t offset, size_t count, etp_worker *self) { size_t todo = count; @@ -1018,11 +1020,11 @@ #endif /* sendfile always needs emulation */ -static ssize_t +static eio_ssize_t eio__sendfile (int ofd, int ifd, off_t offset, size_t count, etp_worker *self) { - ssize_t written = 0; - ssize_t res; + eio_ssize_t written = 0; + eio_ssize_t res; if (!count) return 0; @@ -1141,7 +1143,7 @@ while (count) { - ssize_t cnt; + eio_ssize_t cnt; cnt = pread (ifd, eio_buf, count > EIO_BUFSIZE ? EIO_BUFSIZE : count, offset); @@ -1359,7 +1361,7 @@ while (*rel) { - ssize_t len, linklen; + eio_ssize_t len, linklen; char *beg = rel; while (*rel && *rel != '/') @@ -2180,7 +2182,7 @@ REQ (EIO_FCHMOD); req->int1 = fd; req->int2 = (long)mode; SEND; } -eio_req *eio_fchown (int fd, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data) +eio_req *eio_fchown (int fd, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data) { REQ (EIO_FCHOWN); req->int1 = fd; req->int2 = (long)uid; req->int3 = (long)gid; SEND; } @@ -2210,7 +2212,7 @@ REQ (EIO_TRUNCATE); PATH; req->offs = offset; SEND; } -eio_req *eio_chown (const char *path, uid_t uid, gid_t gid, int pri, eio_cb cb, void *data) +eio_req *eio_chown (const char *path, eio_uid_t uid, eio_gid_t gid, int pri, eio_cb cb, void *data) { REQ (EIO_CHOWN); PATH; req->int2 = (long)uid; req->int3 = (long)gid; SEND; } @@ -2367,11 +2369,11 @@ /*****************************************************************************/ /* misc garbage */ -ssize_t +eio_ssize_t eio_sendfile_sync (int ofd, int ifd, off_t offset, size_t count) { etp_worker wrk; - ssize_t ret; + eio_ssize_t ret; wrk.dbuf = 0;