summaryrefslogtreecommitdiff
path: root/eio.c
diff options
context:
space:
mode:
authorroot <root>2011-01-07 21:45:42 +0000
committerroot <root>2011-01-07 21:45:42 +0000
commitddf9c4d55b914eefb8141eb34f77433307113c68 (patch)
tree4dfaf78cef09b5f348a05d8f287dbc5f426cb8c2 /eio.c
parentcec9b1185592639231b9f8816e6f819d3a6b3553 (diff)
*** empty log message ***
Diffstat (limited to 'eio.c')
-rw-r--r--eio.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/eio.c b/eio.c
index 4963fc1..862b5ad 100644
--- a/eio.c
+++ b/eio.c
@@ -81,7 +81,7 @@
# include <signal.h>
# include <dirent.h>
-#if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES
+#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
# include <sys/mman.h>
#endif
@@ -1433,19 +1433,10 @@ eio_page_align (void **addr, size_t *length)
}
#if !_POSIX_MEMLOCK
-# define eio__mlock(a,b) ((errno = ENOSYS), -1)
# define eio__mlockall(a) ((errno = ENOSYS), -1)
#else
static int
-eio__mlock (void *addr, size_t length)
-{
- eio_page_align (&addr, &length);
-
- return mlock (addr, length);
-}
-
-static int
eio__mlockall (int flags)
{
#if __GLIBC__ == 2 && __GLIBC_MINOR__ <= 7
@@ -1465,6 +1456,20 @@ eio__mlockall (int flags)
}
#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)
# define eio__msync(a,b,c) ((errno = ENOSYS), -1)
#else