musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
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.c 10
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);
+}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月22日 08:37:06 +0000

AltStyle によって変換されたページ (->オリジナル) /