Merge "Rename __dso_handle_so.c to __dso_handle_so.h"
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 26673e6..d79e6f3 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -23,7 +23,7 @@
 #        a relevant C stub
 #
 #      - additionally, if the syscall number is different amoung ARM, and x86, MIPS use:
-#        return_type funcname[:syscall_name](parameters) arm_number,x86_number, mips_number
+#        return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number
 #
 # the file is processed by a python script named gensyscalls.py
 #
@@ -123,6 +123,8 @@
 int         madvise(const void *, size_t, int)  220,219,218
 int         mlock(const void *addr, size_t len)    150,150,154
 int         munlock(const void *addr, size_t len)   151,151,155
+int         mlockall(int flags)   152,152,156
+int         munlockall()   153,153,157
 int         mincore(void*  start, size_t  length, unsigned char*  vec)   219,218,217
 int         __ioctl:ioctl(int, int, void *)  54
 int         readv(int, const struct iovec *, int)   145
diff --git a/libc/arch-arm/syscalls.mk b/libc/arch-arm/syscalls.mk
index 565c2bd..62eda87 100644
--- a/libc/arch-arm/syscalls.mk
+++ b/libc/arch-arm/syscalls.mk
@@ -59,6 +59,8 @@
 syscall_src += arch-arm/syscalls/madvise.S
 syscall_src += arch-arm/syscalls/mlock.S
 syscall_src += arch-arm/syscalls/munlock.S
+syscall_src += arch-arm/syscalls/mlockall.S
+syscall_src += arch-arm/syscalls/munlockall.S
 syscall_src += arch-arm/syscalls/mincore.S
 syscall_src += arch-arm/syscalls/__ioctl.S
 syscall_src += arch-arm/syscalls/readv.S
diff --git a/libc/arch-arm/syscalls/mlockall.S b/libc/arch-arm/syscalls/mlockall.S
new file mode 100644
index 0000000..45c782e
--- /dev/null
+++ b/libc/arch-arm/syscalls/mlockall.S
@@ -0,0 +1,14 @@
+/* autogenerated by gensyscalls.py */
+#include <machine/asm.h>
+#include <sys/linux-syscalls.h>
+
+ENTRY(mlockall)
+    .save   {r4, r7}
+    stmfd   sp!, {r4, r7}
+    ldr     r7, =__NR_mlockall
+    swi     #0
+    ldmfd   sp!, {r4, r7}
+    movs    r0, r0
+    bxpl    lr
+    b       __set_syscall_errno
+END(mlockall)
diff --git a/libc/arch-arm/syscalls/munlockall.S b/libc/arch-arm/syscalls/munlockall.S
new file mode 100644
index 0000000..8106965
--- /dev/null
+++ b/libc/arch-arm/syscalls/munlockall.S
@@ -0,0 +1,14 @@
+/* autogenerated by gensyscalls.py */
+#include <machine/asm.h>
+#include <sys/linux-syscalls.h>
+
+ENTRY(munlockall)
+    .save   {r4, r7}
+    stmfd   sp!, {r4, r7}
+    ldr     r7, =__NR_munlockall
+    swi     #0
+    ldmfd   sp!, {r4, r7}
+    movs    r0, r0
+    bxpl    lr
+    b       __set_syscall_errno
+END(munlockall)
diff --git a/libc/arch-mips/syscalls.mk b/libc/arch-mips/syscalls.mk
index 51fd32d..263f307 100644
--- a/libc/arch-mips/syscalls.mk
+++ b/libc/arch-mips/syscalls.mk
@@ -63,6 +63,8 @@
 syscall_src += arch-mips/syscalls/madvise.S
 syscall_src += arch-mips/syscalls/mlock.S
 syscall_src += arch-mips/syscalls/munlock.S
+syscall_src += arch-mips/syscalls/mlockall.S
+syscall_src += arch-mips/syscalls/munlockall.S
 syscall_src += arch-mips/syscalls/mincore.S
 syscall_src += arch-mips/syscalls/__ioctl.S
 syscall_src += arch-mips/syscalls/readv.S
diff --git a/libc/arch-mips/syscalls/mlockall.S b/libc/arch-mips/syscalls/mlockall.S
new file mode 100644
index 0000000..393c090
--- /dev/null
+++ b/libc/arch-mips/syscalls/mlockall.S
@@ -0,0 +1,22 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+    .text
+    .globl mlockall
+    .align 4
+    .ent mlockall
+
+mlockall:
+    .set noreorder
+    .cpload $t9
+    li $v0, __NR_mlockall
+    syscall
+    bnez $a3, 1f
+    move $a0, $v0
+    j $ra
+    nop
+1:
+    la $t9,__set_errno
+    j $t9
+    nop
+    .set reorder
+    .end mlockall
diff --git a/libc/arch-mips/syscalls/munlockall.S b/libc/arch-mips/syscalls/munlockall.S
new file mode 100644
index 0000000..20fa7b8
--- /dev/null
+++ b/libc/arch-mips/syscalls/munlockall.S
@@ -0,0 +1,22 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+    .text
+    .globl munlockall
+    .align 4
+    .ent munlockall
+
+munlockall:
+    .set noreorder
+    .cpload $t9
+    li $v0, __NR_munlockall
+    syscall
+    bnez $a3, 1f
+    move $a0, $v0
+    j $ra
+    nop
+1:
+    la $t9,__set_errno
+    j $t9
+    nop
+    .set reorder
+    .end munlockall
diff --git a/libc/arch-x86/syscalls.mk b/libc/arch-x86/syscalls.mk
index 623c193..2517ebf 100644
--- a/libc/arch-x86/syscalls.mk
+++ b/libc/arch-x86/syscalls.mk
@@ -63,6 +63,8 @@
 syscall_src += arch-x86/syscalls/madvise.S
 syscall_src += arch-x86/syscalls/mlock.S
 syscall_src += arch-x86/syscalls/munlock.S
+syscall_src += arch-x86/syscalls/mlockall.S
+syscall_src += arch-x86/syscalls/munlockall.S
 syscall_src += arch-x86/syscalls/mincore.S
 syscall_src += arch-x86/syscalls/__ioctl.S
 syscall_src += arch-x86/syscalls/readv.S
diff --git a/libc/arch-x86/syscalls/mlockall.S b/libc/arch-x86/syscalls/mlockall.S
new file mode 100644
index 0000000..ad24213
--- /dev/null
+++ b/libc/arch-x86/syscalls/mlockall.S
@@ -0,0 +1,23 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+    .text
+    .type mlockall, @function
+    .globl mlockall
+    .align 4
+
+mlockall:
+    pushl   %ebx
+    mov     8(%esp), %ebx
+    movl    $__NR_mlockall, %eax
+    int     $0x80
+    cmpl    $-129, %eax
+    jb      1f
+    negl    %eax
+    pushl   %eax
+    call    __set_errno
+    addl    $4, %esp
+    orl     $-1, %eax
+1:
+    popl    %ebx
+    ret
diff --git a/libc/arch-x86/syscalls/munlockall.S b/libc/arch-x86/syscalls/munlockall.S
new file mode 100644
index 0000000..c43e162
--- /dev/null
+++ b/libc/arch-x86/syscalls/munlockall.S
@@ -0,0 +1,20 @@
+/* autogenerated by gensyscalls.py */
+#include <sys/linux-syscalls.h>
+
+    .text
+    .type munlockall, @function
+    .globl munlockall
+    .align 4
+
+munlockall:
+    movl    $__NR_munlockall, %eax
+    int     $0x80
+    cmpl    $-129, %eax
+    jb      1f
+    negl    %eax
+    pushl   %eax
+    call    __set_errno
+    addl    $4, %esp
+    orl     $-1, %eax
+1:
+    ret
diff --git a/libc/include/sys/linux-syscalls.h b/libc/include/sys/linux-syscalls.h
index 0568293..89ab167 100644
--- a/libc/include/sys/linux-syscalls.h
+++ b/libc/include/sys/linux-syscalls.h
@@ -119,6 +119,8 @@
 #define __NR_madvise                      (__NR_SYSCALL_BASE + 220)
 #define __NR_mlock                        (__NR_SYSCALL_BASE + 150)
 #define __NR_munlock                      (__NR_SYSCALL_BASE + 151)
+#define __NR_mlockall                     (__NR_SYSCALL_BASE + 152)
+#define __NR_munlockall                   (__NR_SYSCALL_BASE + 153)
 #define __NR_mincore                      (__NR_SYSCALL_BASE + 219)
 #define __NR_pipe                         (__NR_SYSCALL_BASE + 42)
 #define __NR_pipe2                        (__NR_SYSCALL_BASE + 359)
@@ -222,6 +224,8 @@
 #define __NR_fdatasync                    (__NR_SYSCALL_BASE + 148)
 #define __NR_mlock                        (__NR_SYSCALL_BASE + 150)
 #define __NR_munlock                      (__NR_SYSCALL_BASE + 151)
+#define __NR_mlockall                     (__NR_SYSCALL_BASE + 152)
+#define __NR_munlockall                   (__NR_SYSCALL_BASE + 153)
 #define __NR_sched_setparam               (__NR_SYSCALL_BASE + 154)
 #define __NR_sched_getparam               (__NR_SYSCALL_BASE + 155)
 #define __NR_sched_setscheduler           (__NR_SYSCALL_BASE + 156)
@@ -350,6 +354,8 @@
 #define __NR_fdatasync                    (__NR_SYSCALL_BASE + 152)
 #define __NR_mlock                        (__NR_SYSCALL_BASE + 154)
 #define __NR_munlock                      (__NR_SYSCALL_BASE + 155)
+#define __NR_mlockall                     (__NR_SYSCALL_BASE + 156)
+#define __NR_munlockall                   (__NR_SYSCALL_BASE + 157)
 #define __NR_sched_setparam               (__NR_SYSCALL_BASE + 158)
 #define __NR_sched_getparam               (__NR_SYSCALL_BASE + 159)
 #define __NR_sched_setscheduler           (__NR_SYSCALL_BASE + 160)