summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2003-01-10 14:05:26 +0000
committerAndreas Schwab <schwab@suse.de>2003-01-10 14:05:26 +0000
commitb2222ac61c7bfa221fc9ca88a48940af75016ed2 (patch)
treeac5cda2085d1a5d68f78ad832f020c429f9ebc67
parent29d9a17dba956f7d14eb0dd15f71751fd6da02ce (diff)
downloadglibc-b2222ac61c7bfa221fc9ca88a48940af75016ed2.tar.gz
glibc-b2222ac61c7bfa221fc9ca88a48940af75016ed2.tar.xz
glibc-b2222ac61c7bfa221fc9ca88a48940af75016ed2.zip
Optimize for kernels which are known to have the vfork syscall.
-rw-r--r--sysdeps/unix/sysv/linux/m68k/vfork.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/m68k/vfork.S b/sysdeps/unix/sysv/linux/m68k/vfork.S
index ed5e1e81d5..8027b2f801 100644
--- a/sysdeps/unix/sysv/linux/m68k/vfork.S
+++ b/sysdeps/unix/sysv/linux/m68k/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Schwab <schwab@gnu.org>.
 
@@ -20,6 +20,7 @@
 #include <sysdep.h>
 #define _ERRNO_H	1
 #include <bits/errno.h>
+#include <kernel-features.h>
 
 /* Clone the calling process, but without copying the whole address space.
    The calling process is suspended until the new process exits or is
@@ -46,13 +47,20 @@ ENTRY (__vfork)
 	/* Push back the return PC.  */
 	movel	%a0,%sp@-
 
+# ifdef __ASSUME_VFORK_SYSCALL
+#  ifndef PIC
+	jbra	SYSCALL_ERROR_LABEL
+#  endif
+# else
 	/* Check if vfork syscall is known at all.  */
 	movel	#-ENOSYS,%d1
 	cmpl	%d0,%d1
 	jne	SYSCALL_ERROR_LABEL
 
+# endif
 #endif
 
+#ifndef __ASSUME_VFORK_SYSCALL
 	/* If we don't have vfork, fork is close enough.  */
 
 	movel	#SYS_ify (fork), %d0
@@ -60,6 +68,7 @@ ENTRY (__vfork)
 	tstl	%d0
 	jmi	SYSCALL_ERROR_LABEL
 	rts
+#endif
 
 PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)