… | |
… | |
16 | #include <sys/statvfs.h> |
16 | #include <sys/statvfs.h> |
17 | #include <limits.h> |
17 | #include <limits.h> |
18 | #include <fcntl.h> |
18 | #include <fcntl.h> |
19 | #include <sched.h> |
19 | #include <sched.h> |
20 | |
20 | |
21 | #if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES |
21 | #if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES |
22 | # include <sys/mman.h> |
22 | # include <sys/mman.h> |
23 | #endif |
23 | #endif |
24 | |
24 | |
25 | /* perl namespace pollution */ |
25 | /* perl namespace pollution */ |
26 | #undef VERSION |
26 | #undef VERSION |
… | |
… | |
1524 | if (!SvOK (length) || len + offset > svlen) |
1524 | if (!SvOK (length) || len + offset > svlen) |
1525 | len = svlen - offset; |
1525 | len = svlen - offset; |
1526 | |
1526 | |
1527 | addr = (void *)(((intptr_t)addr) + offset); |
1527 | addr = (void *)(((intptr_t)addr) + offset); |
1528 | eio_page_align (&addr, &len); |
1528 | eio_page_align (&addr, &len); |
1529 | #if _POSIX_MEMLOCK |
1529 | #if _POSIX_MEMLOCK_RANGE |
1530 | RETVAL = munlock (addr, len); |
1530 | RETVAL = munlock (addr, len); |
1531 | #else |
1531 | #else |
1532 | RETVAL = ((errno = ENOSYS), -1); |
1532 | RETVAL = ((errno = ENOSYS), -1); |
1533 | #endif |
1533 | #endif |
1534 | } |
1534 | } |