summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-16 15:40:50 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:40 +0200
commit0a043c30ee71245dfe7c9d82d654312c5e1f6127 (patch)
tree5596b98af169f71b9ce8d3ba0f0088b271bee2c2 /libc/sysdeps/linux/common
parent917176e71ef901297e420bbb0db99be5e8100fc3 (diff)
vfork: make all archs consistent
__vfork is hidden. __GI_vfork is strong (not weak as it was). vfork is weak. e1 can use the generic version. Note: libc_hidden_def(x) has different meaning in .c and .S files. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/vfork.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
index e7c920892..a70ed4a63 100644
--- a/libc/sysdeps/linux/common/vfork.c
+++ b/libc/sysdeps/linux/common/vfork.c
@@ -4,30 +4,22 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
-#include <unistd.h>
-#include <sys/types.h>
#include <sys/syscall.h>
+#if (defined __NR_vfork || (defined __ARCH_USE_MMU__ && defined __NR_fork)) && (defined __USE_BSD || defined __USE_XOPEN_EXTENDED)
+# include <unistd.h>
extern __typeof(vfork) __vfork attribute_hidden;
-#ifdef __NR_vfork
-
-# define __NR___vfork __NR_vfork
+# ifdef __NR_vfork
+# define __NR___vfork __NR_vfork
_syscall0(pid_t, __vfork)
-
-weak_alias(__vfork,vfork)
-libc_hidden_weak(vfork)
-
-#elif defined __ARCH_USE_MMU__ && defined __NR_fork
-
+# else
/* Trivial implementation for arches that lack vfork */
-
pid_t __vfork(void)
{
return fork();
}
-
-weak_alias(__vfork,vfork)
+# endif
+strong_alias(__vfork,vfork)
libc_hidden_weak(vfork)
-
#endif