1 /* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
2 Copyright (C) 2001 Hewlett-Packard Australia
4 This program is free software; you can redistribute it and/or modify it under
5 the terms of the GNU Library General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option) any
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
14 You should have received a copy of the GNU Library General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>.
17 Derived in part from the Linux-8086 C library, the GNU C Library, and several
18 other sundry sources. Files within this library are copyright by their
19 respective copyright holders.
22 #include <sys/syscall.h>
24 #include <bits/errno.h>
26 /* Clone the calling process, but without copying the whole address space.
27 The calling process is suspended until the new process exits or is
28 replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
29 and the process ID of the new process to the old process. */
34 .type __vfork,@function
39 trapa #__SH_SYSCALL_TRAP_BASE
42 /* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */
60 not r1, r1 /* r1=0 means r0 = -1 to -4095 */
61 tst r1, r1 /* i.e. error in linux */
68 /* If we don't have vfork, use fork. */
70 trapa #__SH_SYSCALL_TRAP_BASE
73 /* 12 arithmetic shifts for the crappy sh2, because shad doesn't exist! */
91 not r1, r1 /* r1=0 means r0 = -1 to -4095 */
92 tst r1, r1 /* i.e. error in linux */
107 .size __vfork, .-__vfork
108 weak_alias(__vfork,vfork)
109 libc_hidden_def(vfork)
111 #include "syscall_error.S"