summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-02-08 18:25:19 +0000
committerUlrich Drepper <drepper@redhat.com>2006-02-08 18:25:19 +0000
commite32f487e1cb6e7ed6eb494afde072e1405d5a5fb (patch)
tree7c87768f0f8941e0335f0c2f207fd2db7ff0ff9e
parentb576fca12abea4bb0b5af097ce4dd3ff7717d821 (diff)
downloadglibc-e32f487e1cb6e7ed6eb494afde072e1405d5a5fb.tar.gz
glibc-e32f487e1cb6e7ed6eb494afde072e1405d5a5fb.tar.xz
glibc-e32f487e1cb6e7ed6eb494afde072e1405d5a5fb.zip
* sysdeps/unix/sysv/linux/bits/sched.h: Declare unshare.
	* sysdeps/unix/sysv/linux/Versions [libc, GLIBC_2.4]: Export
	unshare.
	* sysdeps/unix/sysv/linux/syscalls.list: Add unshare syscall.

	* sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Add some
	preprocessor magic so that the compiler won't see the prototypes
	for the functions we are defining as stubs.
-rw-r--r--ChangeLog11
-rw-r--r--sysdeps/unix/Makefile10
-rw-r--r--sysdeps/unix/sysv/linux/Versions2
-rw-r--r--sysdeps/unix/sysv/linux/bits/sched.h5
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list1
5 files changed, 26 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 4cb7c53f2a..902544d51d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-02-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/bits/sched.h: Declare unshare.
+	* sysdeps/unix/sysv/linux/Versions [libc, GLIBC_2.4]: Export
+	unshare.
+	* sysdeps/unix/sysv/linux/syscalls.list: Add unshare syscall.
+
+	* sysdeps/unix/Makefile ($(objpfx)stub-syscalls.c): Add some
+	preprocessor magic so that the compiler won't see the prototypes
+	for the functions we are defining as stubs.
+
 2006-02-05  Ulrich Drepper  <drepper@redhat.com>
 
 	* io/ftw.c (ftw_startup): Use fchdir to return to original
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
index 5b326e032c..c1da42f953 100644
--- a/sysdeps/unix/Makefile
+++ b/sysdeps/unix/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003
+# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003, 2006
 #	Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -294,7 +294,13 @@ sysdep_routines += stub-syscalls
 $(objpfx)stub-syscalls.c: $(common-objpfx)sysd-syscalls \
 			  $(..)sysdeps/unix/Makefile
 	$(make-target-directory)
-	(echo '#include <errno.h>'; \
+	(for call in $(unix-stub-syscalls); do \
+	   echo "#define $$call RENAMED_$$call"; \
+	 done; \
+	 echo '#include <errno.h>'; \
+	 for call in $(unix-stub-syscalls); do \
+	   echo "#undef $$call"; \
+	 done; \
 	 echo 'long int _no_syscall (void)'; \
 	 echo '{ __set_errno (ENOSYS); return -1L; }'; \
 	 for call in $(unix-stub-syscalls); do \
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index 436573a428..fed28f2db0 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -118,6 +118,8 @@ libc {
   GLIBC_2.4 {
     inotify_init; inotify_add_watch; inotify_rm_watch;
 
+    unshare;
+
     #errlist-compat	132
     _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
   }
diff --git a/sysdeps/unix/sysv/linux/bits/sched.h b/sysdeps/unix/sysv/linux/bits/sched.h
index 2ca7df0d13..4a95a263f7 100644
--- a/sysdeps/unix/sysv/linux/bits/sched.h
+++ b/sysdeps/unix/sysv/linux/bits/sched.h
@@ -69,10 +69,13 @@ struct sched_param
 
 __BEGIN_DECLS
 
-/* Clone current process.  */
 #ifdef __USE_MISC
+/* Clone current process.  */
 extern int clone (int (*__fn) (void *__arg), void *__child_stack,
 		  int __flags, void *__arg, ...) __THROW;
+
+/* Unshare the specified resources.  */
+extern int unshare (int __flags) __THROW;
 #endif
 
 __END_DECLS
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 88e1f5a294..053d7e0ccf 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -73,6 +73,7 @@ sigaltstack	-	sigaltstack	i:PP	__sigaltstack	sigaltstack
 sysinfo		EXTRA	sysinfo		i:p	sysinfo
 swapon		-	swapon		i:si	__swapon	swapon
 swapoff		-	swapoff		i:s	__swapoff	swapoff
+unshare		EXTRA	unshare		i:i	unshare
 uselib		EXTRA	uselib		i:s	uselib
 wait4		-	wait4		i:iWiP	__wait4		wait4