mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
update from main arhive 970119
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
|
||||
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
/* clone is even more special than fork as it mucks with stacks
|
||||
and invokes a function in the right context after its all over. */
|
||||
@@ -23,7 +23,7 @@ Cambridge, MA 02139, USA. */
|
||||
#define _ERRNO_H 1
|
||||
#include <errnos.h>
|
||||
|
||||
/* int clone (int (*fn) (), void *child_stack, int flags, int nargs, ...) */
|
||||
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
|
||||
|
||||
.text
|
||||
ENTRY (__clone)
|
||||
@@ -36,18 +36,9 @@ ENTRY (__clone)
|
||||
movel 8(%sp), %a1 /* no NULL stack pointers */
|
||||
tstl %a1
|
||||
jeq syscall_error
|
||||
movel 16(%sp), %d1 /* no negative argument counts */
|
||||
jmi syscall_error
|
||||
|
||||
/* Allocate space on the new stack and copy args over */
|
||||
movel %d1, %d0
|
||||
negl %d0
|
||||
lea (%a1,%d0.l*4), %a1
|
||||
jeq 2f
|
||||
1: movel 16(%sp,%d1.l*4), -4(%a1,%d1.l*4)
|
||||
subql #1, %d1
|
||||
jne 1b
|
||||
2:
|
||||
/* Allocate space and copy the argument onto the new stack. */
|
||||
movel 16(%sp), -(%a1)
|
||||
|
||||
/* Do the system call */
|
||||
exg %d2, %a1 /* save %d2 and get stack pointer */
|
||||
|
||||
Reference in New Issue
Block a user