diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/sysdep.h | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/syscalls.list | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/syscalls.list | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/vfork.c | 51 |
6 files changed, 75 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index a6971ff45f..8b758fa469 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -1,6 +1,6 @@ -/* Copyright (C) 1992, 93, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1992, 93, 95, 96, 97, 98, 99 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995. + Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -243,11 +243,10 @@ asm (".L__X'%ebx = 1\n\t" ({ \ unsigned int resultvar; \ asm volatile ( \ - "bpushl .L__X'%k2, %k2\n\t" \ - "bmovl .L__X'%k2, %k2\n\t" \ + LOADARGS_##nr \ "movl %1, %%eax\n\t" \ "int $0x80\n\t" \ - "bpopl .L__X'%k2, %k2\n\t" \ + RESTOREARGS_##nr \ : "=a" (resultvar) \ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc"); \ if (resultvar >= 0xfffff001) \ @@ -257,6 +256,23 @@ asm (".L__X'%ebx = 1\n\t" } \ (int) resultvar; }) +#define LOADARGS_0 +#define LOADARGS_1 \ + "bpushl .L__X'%k2, %k2\n\t" \ + "bmovl .L__X'%k2, %k2\n\t" +#define LOADARGS_2 LOADARGS_1 +#define LOADARGS_3 LOADARGS_1 +#define LOADARGS_4 LOADARGS_1 +#define LOADARGS_5 LOADARGS_1 + +#define RESTOREARGS_0 +#define RESTOREARGS_1 \ + "bpopl .L__X'%k2, %k2\n\t" +#define RESTOREARGS_2 RESTOREARGS_1 +#define RESTOREARGS_3 RESTOREARGS_1 +#define RESTOREARGS_4 RESTOREARGS_1 +#define RESTOREARGS_5 RESTOREARGS_1 + #define ASMFMT_0() #define ASMFMT_1(arg1) \ , "acdSD" (arg1) diff --git a/sysdeps/unix/sysv/linux/powerpc/syscalls.list b/sysdeps/unix/sysv/linux/powerpc/syscalls.list index 2d95d67046..40ba2f5dd2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/syscalls.list +++ b/sysdeps/unix/sysv/linux/powerpc/syscalls.list @@ -27,6 +27,7 @@ s_sigprocmask sigprocmask sigprocmask 3 __syscall_sigprocmask s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend s_sysctl sysctl _sysctl 1 __syscall__sysctl s_ustat ustat ustat 2 __syscall_ustat +s_vfork vfork vfork 0 __syscall_vfork sys_fstat fxstat fstat 2 __syscall_fstat sys_lstat lxstat lstat 2 __syscall_lstat sys_mknod xmknod mknod 3 __syscall_mknod diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list index 6794891ec8..e9d63f3c8a 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list @@ -37,6 +37,7 @@ s_sigprocmask sigprocmask sigprocmask 3 __syscall_sigprocmask s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend s_sysctl sysctl _sysctl 1 __syscall__sysctl s_ustat ustat ustat 2 __syscall_ustat +s_vfork vfork vfork 0 __syscall_vfork sys_fstat fxstat fstat 2 __syscall_fstat sys_lstat lxstat lstat 2 __syscall_lstat sys_mknod xmknod mknod 3 __syscall_mknod diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list index 5e04be3f54..0d76d25c93 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list @@ -56,6 +56,7 @@ s_sigprocmask sigprocmask sigprocmask 3 __syscall_sigprocmask s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend s_sysctl sysctl _sysctl 1 __syscall__sysctl s_ustat ustat ustat 2 __syscall_ustat +s_vfork vfork vfork 0 __syscall_vfork sys_fstat fxstat fstat 2 __syscall_fstat sys_lstat lxstat lstat 2 __syscall_lstat sys_mknod xmknod mknod 3 __syscall_mknod diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 7b8d5ccb7b..3ced59667d 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -8,7 +8,7 @@ create_module EXTRA create_module 3 create_module delete_module EXTRA delete_module 3 delete_module fdatasync - fdatasync 1 fdatasync flock - flock 2 __flock flock -fork - fork 0 __fork fork +fork - fork 0 __syscall_fork __fork fork get_kernel_syms EXTRA get_kernel_syms 1 get_kernel_syms getegid - getegid 0 __getegid getegid geteuid - geteuid 0 __geteuid geteuid diff --git a/sysdeps/unix/sysv/linux/vfork.c b/sysdeps/unix/sysv/linux/vfork.c index 9b4dd5f121..de250e8ebb 100644 --- a/sysdeps/unix/sysv/linux/vfork.c +++ b/sysdeps/unix/sysv/linux/vfork.c @@ -1 +1,50 @@ -#include <sysdeps/generic/vfork.c> +/* Copyright (C) 1992, 1995, 1997, 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include <errno.h> +#include <unistd.h> + +#include <sysdep.h> +#include <sys/syscall.h> + +extern pid_t __syscall_fork __P ((void)); + +#ifdef __NR_vfork +extern pid_t __syscall_vfork __P ((void)); + +/* Use the system call. If it's not available, fork is close enough. */ + +pid_t +__vfork __P ((void)) +{ + pid_t retval = INLINE_SYSCALL (vfork, 0); + + if (retval == (pid_t) -1 && errno == ENOSYS) + retval = INLINE_SYSCALL (fork, 0); + + return retval; +} +#else +pid_t +__vfork __P ((void)) +{ + return INLINE_SYSCALL (fork, 0); +} +#endif + +weak_alias (__vfork, vfork) |