|
@ -81,7 +81,7 @@ |
|
|
# include <signal.h> |
|
|
# include <signal.h> |
|
|
# include <dirent.h> |
|
|
# include <dirent.h> |
|
|
|
|
|
|
|
|
#if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES |
|
|
#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES |
|
|
# include <sys/mman.h> |
|
|
# include <sys/mman.h> |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
@ -818,12 +818,10 @@ eio__pwrite (int fd, void *buf, size_t count, off_t offset) |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#ifndef HAVE_FUTIMES |
|
|
#ifndef HAVE_UTIMES |
|
|
|
|
|
|
|
|
# undef utimes |
|
|
# undef utimes |
|
|
# undef futimes |
|
|
|
|
|
# define utimes(path,times) eio__utimes (path, times) |
|
|
# define utimes(path,times) eio__utimes (path, times) |
|
|
# define futimes(fd,times) eio__futimes (fd, times) |
|
|
|
|
|
|
|
|
|
|
|
static int |
|
|
static int |
|
|
eio__utimes (const char *filename, const struct timeval times[2]) |
|
|
eio__utimes (const char *filename, const struct timeval times[2]) |
|
@ -841,6 +839,13 @@ eio__utimes (const char *filename, const struct timeval times[2]) |
|
|
return utime (filename, 0); |
|
|
return utime (filename, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_FUTIMES |
|
|
|
|
|
|
|
|
|
|
|
# undef futimes |
|
|
|
|
|
# define futimes(fd,times) eio__futimes (fd, times) |
|
|
|
|
|
|
|
|
static int eio__futimes (int fd, const struct timeval tv[2]) |
|
|
static int eio__futimes (int fd, const struct timeval tv[2]) |
|
|
{ |
|
|
{ |
|
|
errno = ENOSYS; |
|
|
errno = ENOSYS; |
|
@ -1428,18 +1433,9 @@ eio_page_align (void **addr, size_t *length) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if !_POSIX_MEMLOCK |
|
|
#if !_POSIX_MEMLOCK |
|
|
# define eio__mlock(a,b) ((errno = ENOSYS), -1) |
|
|
|
|
|
# define eio__mlockall(a) ((errno = ENOSYS), -1) |
|
|
# define eio__mlockall(a) ((errno = ENOSYS), -1) |
|
|
#else |
|
|
#else |
|
|
|
|
|
|
|
|
static int |
|
|
|
|
|
eio__mlock (void *addr, size_t length) |
|
|
|
|
|
{ |
|
|
|
|
|
eio_page_align (&addr, &length); |
|
|
|
|
|
|
|
|
|
|
|
return mlock (addr, length); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int |
|
|
static int |
|
|
eio__mlockall (int flags) |
|
|
eio__mlockall (int flags) |
|
|
{ |
|
|
{ |
|
@ -1460,6 +1456,20 @@ eio__mlockall (int flags) |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if !_POSIX_MEMLOCK_RANGE |
|
|
|
|
|
# define eio__mlock(a,b) ((errno = ENOSYS), -1) |
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
|
|
static int |
|
|
|
|
|
eio__mlock (void *addr, size_t length) |
|
|
|
|
|
{ |
|
|
|
|
|
eio_page_align (&addr, &length); |
|
|
|
|
|
|
|
|
|
|
|
return mlock (addr, length); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
#if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO) |
|
|
#if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO) |
|
|
# define eio__msync(a,b,c) ((errno = ENOSYS), -1) |
|
|
# define eio__msync(a,b,c) ((errno = ENOSYS), -1) |
|
|
#else |
|
|
#else |
|
@ -1632,8 +1642,6 @@ static void eio_api_destroy (eio_req *req) |
|
|
|
|
|
|
|
|
static void eio_execute (etp_worker *self, eio_req *req) |
|
|
static void eio_execute (etp_worker *self, eio_req *req) |
|
|
{ |
|
|
{ |
|
|
errno = 0; |
|
|
|
|
|
|
|
|
|
|
|
switch (req->type) |
|
|
switch (req->type) |
|
|
{ |
|
|
{ |
|
|
case EIO_READ: ALLOC (req->size); |
|
|
case EIO_READ: ALLOC (req->size); |
|
@ -1724,7 +1732,6 @@ static void eio_execute (etp_worker *self, eio_req *req) |
|
|
else |
|
|
else |
|
|
times = 0; |
|
|
times = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
req->result = req->type == EIO_FUTIME |
|
|
req->result = req->type == EIO_FUTIME |
|
|
? futimes (req->int1, times) |
|
|
? futimes (req->int1, times) |
|
|
: utimes (req->ptr1, times); |
|
|
: utimes (req->ptr1, times); |
|
@ -1743,6 +1750,7 @@ static void eio_execute (etp_worker *self, eio_req *req) |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
|
|
|
errno = ENOSYS; |
|
|
req->result = -1; |
|
|
req->result = -1; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|