support archs with no mlock syscall, only mlock2
authorDrew DeVault <sir@cmpwn.com>
Thu, 21 Mar 2019 15:32:38 +0000 (11:32 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 22 Mar 2019 01:15:56 +0000 (21:15 -0400)
src/mman/mlock.c

index e683a44aefc97ca1ec72036c46eec5ff754c9b92..71af582fe6a3eb1538a59a1dded009d16ab062b8 100644 (file)
@@ -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
 }