From 00ef7ea7dcf941374543b052a0e1f2b955008aff Mon Sep 17 00:00:00 2001
From: Eric Andersen <andersen@codepoet.org>
Date: Fri, 25 May 2001 23:24:53 +0000
Subject: Enable mlock and friends if __UCLIBC_HAS_MMU__ is defined. 
 util-linux needs this to compile.

---
 libc/sysdeps/linux/common/syscalls.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

(limited to 'libc/sysdeps/linux')

diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index b1fe3dc98..e0aa4a91e 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -1037,10 +1037,39 @@ _syscall1(pid_t, getsid, pid_t, pid);
 
 //#define __NR_fdatasync        148
 //#define __NR__sysctl          149
+
 //#define __NR_mlock            150
+#ifdef L_mlock
+#include <sys/mman.h>
+#	if defined __UCLIBC_HAS_MMU__ && defined __NR_mlock
+		_syscall2(int, mlock, const void *, addr, size_t, len);
+#	endif	
+#endif	
+
 //#define __NR_munlock          151
+#ifdef L_munlock
+#include <sys/mman.h>
+#	if defined __UCLIBC_HAS_MMU__ && defined __NR_munlock
+		_syscall2(int, munlock, const void *, addr, size_t, len);
+#	endif	
+#endif	
+
 //#define __NR_mlockall         152
+#ifdef L_mlockall
+#include <sys/mman.h>
+#	if defined __UCLIBC_HAS_MMU__ && defined __NR_mlockall
+		_syscall1(int, mlockall, int, flags);
+#	endif	
+#endif	
+
 //#define __NR_munlockall       153
+#ifdef L_munlockall
+#include <sys/mman.h>
+#	if defined __UCLIBC_HAS_MMU__ && defined L_munlockall
+		_syscall0(int, munlockall);
+#	endif	
+#endif	
+
 //#define __NR_sched_setparam   154
 //#define __NR_sched_getparam   155
 //#define __NR_sched_setscheduler       156
-- 
cgit v1.2.3