about summary refs log tree commit diff
path: root/src/linux/mlock2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/mlock2.c')
-rw-r--r--src/linux/mlock2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/linux/mlock2.c b/src/linux/mlock2.c
new file mode 100644
index 00000000..10132742
--- /dev/null
+++ b/src/linux/mlock2.c
@@ -0,0 +1,10 @@
+#define _GNU_SOURCE 1
+#include <sys/mman.h>
+#include "syscall.h"
+
+int mlock2(const void *addr, size_t len, unsigned flags)
+{
+	if (flags == 0)
+		return mlock(addr, len);
+	return syscall(SYS_mlock2, addr, len, flags);
+}