[1/3] mman/mlock: use mlock2 when appropriate

Submitted by Drew DeVault on March 21, 2019, 3:32 p.m.

Details

Message ID 20190321153240.29328-2-sir@cmpwn.com
State New
Series "Use v2 syscalls when appropriate"
Headers show

Commit Message

Drew DeVault March 21, 2019, 3:32 p.m.
---
 src/mman/mlock.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/mman/mlock.c b/src/mman/mlock.c
index e683a44a..71af582f 100644
--- a/src/mman/mlock.c
+++ b/src/mman/mlock.c
@@ -3,5 +3,9 @@ 
 
 int mlock(const void *addr, size_t len)
 {
+#ifdef SYS_mlock
 	return syscall(SYS_mlock, addr, len);
+#else
+	return syscall(SYS_mlock2, addr, len, 0);
+#endif
 }