This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: vfork
- To: drepper@cygnus.com
- Subject: Re: vfork
- From: Geoff Keating <geoffk@ozemail.com.au>
- Date: Wed, 20 Jan 1999 17:05:40 +1100
- CC: libc-hacker@cygnus.com
- References: <r2k8yiu8uc.fsf@happy.cygnus.com>
> Reply-To: drepper@cygnus.com (Ulrich Drepper)
> From: Ulrich Drepper <drepper@cygnus.com>
> Date: 19 Jan 1999 15:43:55 -0800
>
> I think I got the ix86 vfork implementation right now (after the
> kernel people again changed their code). Now we should have correct
> code for ix86, alpha, and SPARC*. Since I'd like to make 2.0.111 ASAP
> please try to get the implementations for m68, ARM, and PPC in place
> (or send them to me). If somebody cares about MIPS I'd like to see it
> of course as well.
That's easy. Please do not implement vfork() for powerpc for version
2.1. I have some concerns about whether it would be safe,
particularly with varargs and suchlike---this feeds into interesting
optimisation issues of the form "can egcs ever do x".
I'll have some time to properly check its safety in about a month, by
which time I hope we'll be thinking of version 2.1.1.
I attach below a completely untested (not even compiled) version of
the new vfork assembler.
--
Geoffrey Keating <geoffk@ozemail.com.au>
===File ~/patches/vfork.S===================================
/* vfork system call for Linux/ppc.
Copyright (C) 1995, 1996, 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 <sysdep.h>
#define _SCHED_H 1
#include <bits/sched.h>
#define _ERRNO_H 1
#include <bits/errno.h>
.section ".text"
ENTRY(__vfork)
li %r3,CLONE_VFORK+CLONE_VM+SIGCHLD
li %r4,0
DO_CALL(SYS_ify(clone))
bnslr
cmpwi %cr1,%r3,ENOSYS
bne %cr1,0f
DO_CALL(SYS_ify(fork))
bnslr
0: b JUMPTARGET(__syscall_error)
END (__vfork)
weak_alias (__vfork, vfork)
============================================================
- References:
- vfork
- From: Ulrich Drepper <drepper@cygnus.com>
- vfork
- From: Ulrich Drepper <drepper@cygnus.com>