Commit d24b3431 authored by Kirill Smelkov's avatar Kirill Smelkov Committed by Stefan Behnel

include: posix.mman += mlock2, MLOCK_ONFAULT, MCL_ONFAULT

mlock2 is Linux-specific version of mlock that accepts flags. The only
flag available so far is MLOCK_ONFAULT which asks to lock pages only at
the time when they are faulted in, not in the beginning. MCL_ONFAULT is
Linux-specific flag to mlockall which requests similar behaviour.

http://man7.org/linux/man-pages/man2/mlock2.2.html

(cherry picked from commit 83a5700b)
parent f5de8c42
...@@ -46,6 +46,10 @@ cdef extern from "<sys/mman.h>" nogil: ...@@ -46,6 +46,10 @@ cdef extern from "<sys/mman.h>" nogil:
int munlock(const void *addr, size_t Len) int munlock(const void *addr, size_t Len)
int mlockall(int flags) int mlockall(int flags)
int munlockall() int munlockall()
# Linux-specific
enum: MLOCK_ONFAULT
enum: MCL_ONFAULT
int mlock2(const void *addr, size_t len, int flags)
int shm_open(const char *name, int oflag, mode_t mode) int shm_open(const char *name, int oflag, mode_t mode)
int shm_unlink(const char *name) int shm_unlink(const char *name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment