Remove *xattr syscalls.
[glibc.git] / sysdeps / unix / sysv / linux / m68k / vfork.S
blobb77a7bd15fbab52369e4b0531725f1f91df7d2d6
1 /* Copyright (C) 1999 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3    Contributed by Andreas Schwab <schwab@gnu.org>.
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18    02111-1307 USA.  */
20 #include <sysdep.h>
21 #define _ERRNO_H        1
22 #include <bits/errno.h>
24 /* Clone the calling process, but without copying the whole address space.
25    The calling process is suspended until the new process exits or is
26    replaced by a call to `execve'.  Return -1 for errors, 0 to the new process,
27    and the process ID of the new process to the old process.  */
29 ENTRY (__vfork)
31 #ifdef __NR_vfork
33         /* Pop the return PC value into A0.  */
34         movel   %sp@+, %a0
36         /* Stuff the syscall number in D0 and trap into the kernel.  */
37         movel   #SYS_ify (vfork), %d0
38         trap    #0
39         tstl    %d0
40         jmi     .Lerror         /* Branch forward if it failed.  */
42         /* Jump to the return PC.  */
43         jmp     %a0@
45 .Lerror:
46         /* Push back the return PC.  */
47         movel   %a0,%sp@-
49         /* Check if vfork syscall is known at all.  */
50         movel   #-ENOSYS,%d1
51         cmpl    %d0,%d1
52         jne     SYSCALL_ERROR_LABEL
54 #endif
56         /* If we don't have vfork, fork is close enough.  */
58         movel   #SYS_ify (fork), %d0
59         trap    #0
60         tstl    %d0
61         jmi     SYSCALL_ERROR_LABEL
62         rts
64 PSEUDO_END (__vfork)
66 weak_alias (__vfork, vfork)