1 /* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3 The GNU C Library is free software; you can redistribute it and/or
4 modify it under the terms of the GNU Library General Public License as
5 published by the Free Software Foundation; either version 2 of the
6 License, or (at your option) any later version.
8 The GNU C Library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
13 You should have received a copy of the GNU Library General Public
14 License along with the GNU C Library; see the file COPYING.LIB. If not,
15 see <http://www.gnu.org/licenses/>. */
17 /* clone() is even more special than fork() as it mucks with stacks
18 and invokes a function in the right context after its all over. */
20 #include <sys/syscall.h>
22 #warning "This file contains a hardcoded constant for SYS_clone"
26 .LC0: .long 120 /* SYS_clone */
38 /* Sanity check args. */
40 jeql CLONE_ERROR_LABEL
42 jeql CLONE_ERROR_LABEL
44 /* Need to setup the child stack the same as the parent. */
52 /* Do the system call. */
58 chmk .LC0 /* %r0 .LC0 -4(%fp) -8(%fp) */
62 jneq CLONE_ERROR_LABEL
69 calls $1, HIDDEN_JUMPTARGET(_exit)
72 cmpl %r6, $-126 /* -ENOKEY?!?! Fuck, this must be wrong! FIXME */
73 jlequ CLONE_RETURN_LABEL
74 calls $0, __errno_location