diff options
author | 2012-04-12 12:33:03 +0000 | |
---|---|---|
committer | 2012-04-12 12:33:03 +0000 | |
commit | 78f78c26c3995239464fa4d653a026095e06effa (patch) | |
tree | a27a0006a7744ad73e7478c4f882ec9fbccd56f5 /lib/libc | |
parent | Revert change not intended to be committed. (diff) | |
download | wireguard-openbsd-78f78c26c3995239464fa4d653a026095e06effa.tar.xz wireguard-openbsd-78f78c26c3995239464fa4d653a026095e06effa.zip |
remove rfork(); ok guenther miod
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/arch/alpha/sys/rfork.S | 36 | ||||
-rw-r--r-- | lib/libc/arch/amd64/sys/rfork.S | 44 | ||||
-rw-r--r-- | lib/libc/arch/arm/sys/rfork.S | 32 | ||||
-rw-r--r-- | lib/libc/arch/hppa/sys/rfork.S | 38 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/sys/rfork.S | 38 | ||||
-rw-r--r-- | lib/libc/arch/i386/sys/rfork.S | 39 | ||||
-rw-r--r-- | lib/libc/arch/ia64/sys/rfork.S | 3 | ||||
-rw-r--r-- | lib/libc/arch/m68k/sys/rfork.S | 40 | ||||
-rw-r--r-- | lib/libc/arch/m88k/sys/rfork.S | 45 | ||||
-rw-r--r-- | lib/libc/arch/mips64/sys/rfork.S | 57 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/sys/rfork.S | 32 | ||||
-rw-r--r-- | lib/libc/arch/sh/sys/rfork.S | 32 | ||||
-rw-r--r-- | lib/libc/arch/sparc/sys/rfork.S | 40 | ||||
-rw-r--r-- | lib/libc/arch/sparc64/sys/rfork.S | 43 | ||||
-rw-r--r-- | lib/libc/arch/vax/sys/rfork.S | 37 | ||||
-rw-r--r-- | lib/libc/sys/Makefile.inc | 83 | ||||
-rw-r--r-- | lib/libc/sys/rfork.2 | 185 |
17 files changed, 40 insertions, 784 deletions
diff --git a/lib/libc/arch/alpha/sys/rfork.S b/lib/libc/arch/alpha/sys/rfork.S deleted file mode 100644 index aa302321e99..00000000000 --- a/lib/libc/arch/alpha/sys/rfork.S +++ /dev/null @@ -1,36 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.2 2005/08/07 16:40:13 espie Exp $ */ -/* $NetBSD: rfork.S,v 1.1 1995/02/10 17:50:34 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Carnegie-Mellon University. - * All rights reserved. - * - * Author: Chris G. Demetriou - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include "SYS.h" - -SYSCALL(rfork) - cmovne a4, zero, v0 /* a4 (rv[1]) != 0, child */ - RET -SYSEND(rfork) diff --git a/lib/libc/arch/amd64/sys/rfork.S b/lib/libc/arch/amd64/sys/rfork.S deleted file mode 100644 index 87a6d3a9da6..00000000000 --- a/lib/libc/arch/amd64/sys/rfork.S +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.2 2005/12/13 00:10:48 jsg Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)fork.s 5.1 (Berkeley) 4/23/90 - */ - -#include <machine/asm.h> - -#include "SYS.h" - -SYSCALL(rfork) - decl %edx /* from 1 to 0 in child, 0 to -1 in parent */ - andl %edx,%eax - ret /* pid = rfork(); */ diff --git a/lib/libc/arch/arm/sys/rfork.S b/lib/libc/arch/arm/sys/rfork.S deleted file mode 100644 index 75e011b76a7..00000000000 --- a/lib/libc/arch/arm/sys/rfork.S +++ /dev/null @@ -1,32 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.1 2004/02/01 05:30:41 drahn Exp $ */ - -/* - * Copyright (c) 2004 Dale Rahn - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* pid = rfork() */ - -#include "SYS.h" - -RSYSCALL(rfork) diff --git a/lib/libc/arch/hppa/sys/rfork.S b/lib/libc/arch/hppa/sys/rfork.S deleted file mode 100644 index f4f41201385..00000000000 --- a/lib/libc/arch/hppa/sys/rfork.S +++ /dev/null @@ -1,38 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.5 2006/01/05 22:13:55 kettenis Exp $ */ - -/* - * Copyright (c) 1999 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSENTRY(rfork) - SYSCALL(rfork) - addi -1, ret1, ret1 - bv r0(rp) - and ret0, ret1, ret0 -SYSEXIT(rfork) - - .end diff --git a/lib/libc/arch/hppa64/sys/rfork.S b/lib/libc/arch/hppa64/sys/rfork.S deleted file mode 100644 index b8ea1b67d7d..00000000000 --- a/lib/libc/arch/hppa64/sys/rfork.S +++ /dev/null @@ -1,38 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.4 2011/04/21 14:12:20 jsing Exp $ */ - -/* - * Copyright (c) 1999 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSENTRY(rfork) - SYSCALL(rfork) - addi -1, %ret1, %ret1 - bv %r0(%rp) - and %ret0, %ret1, %ret0 -SYSEXIT(rfork) - - .end diff --git a/lib/libc/arch/i386/sys/rfork.S b/lib/libc/arch/i386/sys/rfork.S deleted file mode 100644 index 6ef6875208a..00000000000 --- a/lib/libc/arch/i386/sys/rfork.S +++ /dev/null @@ -1,39 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSCALL(rfork) - decl %edx /* from 1 to 0 in child, 0 to -1 in parent */ - andl %edx,%eax - ret /* pid = rfork(); */ diff --git a/lib/libc/arch/ia64/sys/rfork.S b/lib/libc/arch/ia64/sys/rfork.S deleted file mode 100644 index 46c51a8c0cb..00000000000 --- a/lib/libc/arch/ia64/sys/rfork.S +++ /dev/null @@ -1,3 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.1 2011/07/05 03:26:18 pirofti Exp $ */ - -/* XXX: Stub */ diff --git a/lib/libc/arch/m68k/sys/rfork.S b/lib/libc/arch/m68k/sys/rfork.S deleted file mode 100644 index dc911be11c4..00000000000 --- a/lib/libc/arch/m68k/sys/rfork.S +++ /dev/null @@ -1,40 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.3 2005/08/07 16:40:14 espie Exp $ */ -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSCALL(rfork) - subql #1,d1 /* from 1 to 0 in child, 0 to -1 in parent */ - andl d1,d0 - rts /* pid = rfork() */ diff --git a/lib/libc/arch/m88k/sys/rfork.S b/lib/libc/arch/m88k/sys/rfork.S deleted file mode 100644 index b75581b8d92..00000000000 --- a/lib/libc/arch/m88k/sys/rfork.S +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.4 2005/08/07 16:40:15 espie Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * the Systems Programming Group of the University of Utah Computer - * Science Department. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -/* r2 = pid. r3 = 0 in parent, 1 in child */ - -SYSCALL(rfork) - bcnd eq0,r3,parent - or r2,r0,0 - or r3,r0,0 -parent: - jmp r1 /* pid = rfork() */ diff --git a/lib/libc/arch/mips64/sys/rfork.S b/lib/libc/arch/mips64/sys/rfork.S deleted file mode 100644 index 1d669c367d2..00000000000 --- a/lib/libc/arch/mips64/sys/rfork.S +++ /dev/null @@ -1,57 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.5 2011/04/04 12:42:39 guenther Exp $ */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -FRAMESZ= MKFSIZ(1,1) -GPOFF= FRAMESZ-2*REGSZ - -SYSLEAF(rfork, FRAMESZ) - PTR_SUBU sp, FRAMESZ - SETUP_GP64(GPOFF, rfork) - .set reorder - li v0, SYS_rfork # pid = fork() - syscall - bne a3, zero, 2f - beq v1, zero, 1f # v1 == 0 in parent, 1 in child - move v0, zero -1: - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - j ra -2: - LA t9, CERROR - RESTORE_GP64 - PTR_ADDU sp, FRAMESZ - jr t9 -SYSEND(rfork) diff --git a/lib/libc/arch/powerpc/sys/rfork.S b/lib/libc/arch/powerpc/sys/rfork.S deleted file mode 100644 index 3408b072f87..00000000000 --- a/lib/libc/arch/powerpc/sys/rfork.S +++ /dev/null @@ -1,32 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.2 2002/10/07 04:47:12 drahn Exp $ */ - -/* - * Copyright (c) 1996 Dale Rahn - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* pid = rfork() */ - -#include "SYS.h" - -RSYSCALL(rfork) diff --git a/lib/libc/arch/sh/sys/rfork.S b/lib/libc/arch/sh/sys/rfork.S deleted file mode 100644 index 9f33b6e559b..00000000000 --- a/lib/libc/arch/sh/sys/rfork.S +++ /dev/null @@ -1,32 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.1.1.1 2006/10/10 22:07:10 miod Exp $ */ - -/* - * Copyright (c) 2004 Dale Rahn - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* pid = rfork() */ - -#include "SYS.h" - -RSYSCALL(rfork) diff --git a/lib/libc/arch/sparc/sys/rfork.S b/lib/libc/arch/sparc/sys/rfork.S deleted file mode 100644 index 14e681c6ae2..00000000000 --- a/lib/libc/arch/sparc/sys/rfork.S +++ /dev/null @@ -1,40 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.3 2005/08/07 16:40:15 espie Exp $ */ -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSCALL(rfork) - dec %o1 ! from 1 to 0 in child, 0 to -1 in parent - retl - and %o0, %o1, %o0 ! return 0 in child, pid in parent diff --git a/lib/libc/arch/sparc64/sys/rfork.S b/lib/libc/arch/sparc64/sys/rfork.S deleted file mode 100644 index 88349f811a8..00000000000 --- a/lib/libc/arch/sparc64/sys/rfork.S +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.2 2003/06/02 20:18:33 millert Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include <machine/asm.h> - -#include "SYS.h" - -SYSCALL(rfork) - dec %o1 /* from 1 to 0 in child, 0 to -1 in parent */ - retl - and %o0, %o1, %o0 /* return 0 in child, pid in parent */ diff --git a/lib/libc/arch/vax/sys/rfork.S b/lib/libc/arch/vax/sys/rfork.S deleted file mode 100644 index ce492169d2a..00000000000 --- a/lib/libc/arch/vax/sys/rfork.S +++ /dev/null @@ -1,37 +0,0 @@ -/* $OpenBSD: rfork.S,v 1.3 2005/08/07 16:40:16 espie Exp $ */ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "SYS.h" - -SYSCALL(rfork) - jlbc r1,1f # parent, since r1 == 0 in parent, 1 in child - clrl r0 -1: - ret # pid = rfork() diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 0afa15f8842..a8233a699b3 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.101 2012/04/12 11:16:24 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.102 2012/04/12 12:33:04 deraadt Exp $ # $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 6/17/93 @@ -6,12 +6,11 @@ .PATH: ${LIBCSRCDIR}/arch/${MACHINE_CPU}/sys ${LIBCSRCDIR}/sys # modules with non-default implementations on at least one architecture: -SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S rfork.S \ +SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S \ sbrk.S sigpending.S sigprocmask.S sigreturn.S \ sigsuspend.S syscall.S tfork_thread.S -LSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c \ - Lint_rfork.c Lint_sbrk.c \ +LSRCS+= Lint_Ovfork.c Lint_brk.c Lint_exect.c Lint_fork.c Lint_sbrk.c \ Lint_sigpending.c Lint_sigprocmask.c Lint_sigreturn.c \ Lint_sigsuspend.c Lint_syscall.c Lint_crt.c Lint_environ.c \ Lint_setjmp.c Lint_longjmp.c \ @@ -214,41 +213,41 @@ LintSysPseudoNoerr.c: ${LIBCSRCDIR}/sys/makelintstub.sh \ @sh ${LIBCSRCDIR}/sys/makelintstub.sh -o ${.TARGET} -p \ -s ${DESTDIR}/usr/include/sys/syscall.h ${PSEUDO_NOERR} -MAN+= accept.2 access.2 acct.2 adjfreq.2 adjtime.2 bind.2 brk.2 chdir.2 \ - chflags.2 \ - chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 connect.2 \ - dup.2 execve.2 _exit.2 fcntl.2 fhopen.2 \ - flock.2 fork.2 fsync.2 getdirentries.2 getdtablecount.2 \ - getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \ - getpeername.2 getpgrp.2 getrtable.2 __get_tcb.2 \ - getpid.2 getpriority.2 getrlimit.2 getrusage.2 getsid.2 getsockname.2 \ - getsockopt.2 gettimeofday.2 getuid.2 intro.2 issetugid.2 ioctl.2 \ - kill.2 kqueue.2 ktrace.2 link.2 \ - listen.2 lseek.2 mkdir.2 mkfifo.2 mknod.2 madvise.2 \ - mquery.2 mincore.2 minherit.2 mlock.2 mlockall.2 \ - mmap.2 mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \ - nfssvc.2 open.2 pathconf.2 \ - pipe.2 profil.2 poll.2 ptrace.2 quotactl.2 read.2 readlink.2 reboot.2 \ - recv.2 rename.2 revoke.2 rfork.2 rmdir.2 select.2 send.2 setgroups.2 \ - setpgid.2 setregid.2 setreuid.2 setresuid.2 setsid.2 setuid.2 \ - shutdown.2 sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 \ - sigreturn.2 sigsuspend.2 socket.2 socketpair.2 stat.2 \ - statfs.2 swapctl.2 symlink.2 sync.2 sysarch.2 syscall.2 \ - __thrsigdivert.2 __thrsleep.2 truncate.2 \ - umask.2 unlink.2 utimes.2 vfork.2 wait.2 write.2 - -MAN+= msgctl.2 shmctl.2 shmat.2 semop.2 semget.2 semctl.2 msgsnd.2 msgrcv.2 \ - msgget.2 shmget.2 +MAN+= __get_tcb.2 __thrsigdivert.2 __thrsleep.2 _exit.2 accept.2 \ + access.2 acct.2 adjfreq.2 adjtime.2 bind.2 brk.2 chdir.2 \ + chflags.2 chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \ + closefrom.2 connect.2 dup.2 execve.2 fcntl.2 fhopen.2 \ + flock.2 fork.2 fsync.2 getdirentries.2 getfh.2 getfsstat.2 \ + getgid.2 getgroups.2 getitimer.2 getlogin.2 getpeername.2 \ + getpgrp.2 getpid.2 getpriority.2 getrlimit.2 getrtable.2 \ + getrusage.2 getsid.2 getsockname.2 getsockopt.2 \ + gettimeofday.2 getuid.2 intro.2 ioctl.2 issetugid.2 \ + kill.2 kqueue.2 ktrace.2 link.2 listen.2 lseek.2 madvise.2 \ + mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 \ + mlockall.2 mmap.2 mount.2 mprotect.2 mquery.2 msgctl.2 \ + msgget.2 msgrcv.2 msgsnd.2 msync.2 munmap.2 nanosleep.2 \ + nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 \ + ptrace.2 quotactl.2 read.2 readlink.2 reboot.2 recv.2 \ + rename.2 revoke.2 rmdir.2 select.2 semctl.2 semget.2 \ + semop.2 send.2 setgroups.2 setpgid.2 setregid.2 \ + setresuid.2 setreuid.2 setsid.2 setuid.2 shmat.2 shmctl.2 \ + shmget.2 shutdown.2 sigaction.2 sigaltstack.2 sigpending.2 \ + sigprocmask.2 sigreturn.2 sigsuspend.2 socket.2 \ + socketpair.2 stat.2 statfs.2 swapctl.2 symlink.2 \ + sync.2 sysarch.2 syscall.2 truncate.2 umask.2 unlink.2 \ + utimes.2 vfork.2 wait.2 write.2 +MLINKS+=__get_tcb.2 __set_tcb.2 +MLINKS+=__thrsleep.2 __thrwakeup.2 MLINKS+=access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 -MLINKS+=dup.2 dup2.2 MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 fchflags.2 MLINKS+=chmod.2 fchmod.2 chmod.2 fchmodat.2 MLINKS+=chown.2 fchown.2 chown.2 fchownat.2 chown.2 lchown.2 -MLINKS+=clock_gettime.2 clock_settime.2 MLINKS+=clock_gettime.2 clock_getres.2 +MLINKS+=clock_gettime.2 clock_settime.2 +MLINKS+=dup.2 dup2.2 MLINKS+=execve.2 exect.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 MLINKS+=getgid.2 getegid.2 @@ -263,14 +262,13 @@ MLINKS+=getpgrp.2 getpgid.2 MLINKS+=getpid.2 getppid.2 MLINKS+=getpriority.2 setpriority.2 MLINKS+=getrlimit.2 setrlimit.2 -MLINKS+=getsockopt.2 setsockopt.2 MLINKS+=getrtable.2 setrtable.2 -MLINKS+=__get_tcb.2 __set_tcb.2 +MLINKS+=getsockopt.2 setsockopt.2 MLINKS+=gettimeofday.2 settimeofday.2 MLINKS+=getuid.2 geteuid.2 +MLINKS+=intro.2 errno.2 MLINKS+=kqueue.2 kevent.2 kqueue.2 EV_SET.2 MLINKS+=link.2 linkat.2 -MLINKS+=intro.2 errno.2 MLINKS+=madvise.2 posix_madvise.2 MLINKS+=mkdir.2 mkdirat.2 MLINKS+=mkfifo.2 mkfifoat.2 @@ -282,28 +280,27 @@ MLINKS+=open.2 openat.2 MLINKS+=pathconf.2 fpathconf.2 MLINKS+=read.2 readv.2 read.2 pread.2 read.2 preadv.2 MLINKS+=readlink.2 readlinkat.2 -MLINKS+=rename.2 renameat.2 MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2 +MLINKS+=rename.2 renameat.2 +MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3 +MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3 MLINKS+=send.2 sendmsg.2 send.2 sendto.2 MLINKS+=setpgid.2 setpgrp.2 -MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2 MLINKS+=setresuid.2 getresgid.2 setresuid.2 getresuid.2 MLINKS+=setresuid.2 setresgid.2 +MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2 MLINKS+=shmat.2 shmdt.2 -MLINKS+=stat.2 fstat.2 stat.2 fstatat.2 stat.2 lstat.2 MLINKS+=stat.2 S_ISBLK.2 stat.2 S_ISCHR.2 stat.2 S_ISDIR.2 MLINKS+=stat.2 S_ISFIFO.2 stat.2 S_ISLNK.2 stat.2 S_ISREG.2 stat.2 S_ISSOCK.2 +MLINKS+=stat.2 fstat.2 stat.2 fstatat.2 stat.2 lstat.2 MLINKS+=statfs.2 fstatfs.2 MLINKS+=symlink.2 symlinkat.2 MLINKS+=syscall.2 __syscall.2 -MLINKS+=__thrsleep.2 __thrwakeup.2 MLINKS+=truncate.2 ftruncate.2 MLINKS+=unlink.2 unlinkat.2 MLINKS+=utimes.2 futimens.2 utimes.2 futimes.2 utimes.2 utimensat.2 -MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 -MLINKS+=write.2 writev.2 write.2 pwrite.2 write.2 pwritev.2 -MLINKS+=select.2 FD_SET.3 select.2 FD_CLR.3 -MLINKS+=select.2 FD_ISSET.3 select.2 FD_ZERO.3 +MLINKS+=wait.2 WEXITSTATUS.2 wait.2 WCOREDUMP.2 wait.2 WSTOPSIG.2 MLINKS+=wait.2 WIFCONTINUED.2 wait.2 WIFEXITED.2 MLINKS+=wait.2 WIFSIGNALED.2 wait.2 WIFSTOPPED.2 wait.2 WTERMSIG.2 -MLINKS+=wait.2 WEXITSTATUS.2 wait.2 WCOREDUMP.2 wait.2 WSTOPSIG.2 +MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2 +MLINKS+=write.2 writev.2 write.2 pwrite.2 write.2 pwritev.2 diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2 deleted file mode 100644 index 1f515d5ff66..00000000000 --- a/lib/libc/sys/rfork.2 +++ /dev/null @@ -1,185 +0,0 @@ -.\" $OpenBSD: rfork.2,v 1.25 2010/06/29 17:54:35 tedu Exp $ -.\" -.\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org> -.\" -.\" Permission to use, copy, modify, and distribute this software for any -.\" purpose with or without fee is hereby granted, provided that the above -.\" copyright notice and this permission notice appear in all copies. -.\" -.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.\" -.Dd $Mdocdate: June 29 2010 $ -.Dt RFORK 2 -.Os -.Sh NAME -.Nm rfork -.Nd control new processes -.Sh SYNOPSIS -.Fd #include <sys/param.h> -.Fd #include <unistd.h> -.Ft int -.Fn rfork "int flags" -.Sh DESCRIPTION -The fork functions -.Po -.Xr fork 2 , -.Xr vfork 2 , -and -.Fn rfork -.Pc -create new processes. -The new process -.Pq child process -is an exact copy of the calling process -.Pq parent process , -except as outlined in the -.Xr fork 2 -manual page. -.Fn rfork -is used to manipulate the resources of the parent process and the -child process. -.Pp -Operations currently supported include whether to copy or share the file -descriptor table between the two processes, whether to share the address -space, and whether the parent should -.Xr wait 2 -for the child process to -.Xr _exit 2 . -.Fn rfork -takes a single argument, -.Fa flags , -which controls which of these resources should be manipulated. -They are defined in the header file -.Aq Pa sys/param.h -and are the logical OR of one or more of the following: -.Bl -tag -width "RFNOWAIT" -.\" .It Dv RFNAMEG -.\" New Plan 9 -.\" .Sq name space . -.\" This is a Plan 9 specific flag, and is not implemented. -.\" .It Dv RFENVG -.\" Copy Plan 9 -.\" .Sq env space . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFFDG -Copy the parent's file descriptor table. -If this flag is unset, the parent and child will share the parent's -file descriptor table. -Descriptors will remain in existence until they are closed by all -child processes using the table copies as well as by the parent process. -May not be used in conjunction with -.Dv RFCFDG . -.\" .It Dv RFNOTEG -.\" Create new Plan 9 -.\" .Sq note group . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFPROC -Create a new process. -The current implementation requires this flag to always be set. -.It Dv RFMEM -Force sharing of the entire address space between the parent and child -processes. -The child will then inherit all the shared segments the parent process owns. -Subsequent forks by the parent will then propagate the shared -data and BSS segments among children. -.It Dv RFNOWAIT -Child processes will have their resources reaped immediately and -implicitly when they terminate instead of turning into zombies, -so the parent process may not call -.Xr wait 2 -to collect their exit statuses and have their resources released -explicitly. -.\" .It Dv RFCNAMEG -.\" Zero Plan 9 -.\" .Sq name space . -.\" This is a Plan 9 specific flag, and is not implemented. -.\" .It Dv RFCENVG -.\" Zero Plan 9 -.\" .Sq env space . -.\" This is a Plan 9 specific flag, and is not implemented. -.It Dv RFCFDG -Zero the child's file descriptor table -.Pq i.e. start with a blank file descriptor table . -May not be used in conjunction with -.Dv RFFDG . -.It Dv RFTHREAD -Create a kernel thread in the current process instead of a separate -process. -Must be combined with -.Dv RFMEM . -Automatically enables -.Dv RFNOWAIT . -The kern.rthreads sysctl must be enabled for this to succeed. -.El -.Pp -.Xr fork 2 -can be implemented as a call to -.Fn rfork -using "RFFDG|RFPROC", but isn't for backwards compatibility. -If a process has file descriptor table sharing active, setuid or setgid -programs will not -.Xr execve 2 -with extra privileges. -.Sh RETURN VALUES -The parent process returns the process ID -.Pq PID -of the child process. -The child process returns 0. -The range of the process ID is defined in -.Aq Pa sys/proc.h -and is currently between 1 and 32766, inclusive. -.Sh ERRORS -.Fn rfork -will fail and no child process will be created if: -.Bl -tag -width Er -.It Bq Er ENOMEM -Cannot allocate memory. -The new process image required more memory than was allowed by the hardware or -by system-imposed memory management constraints. -A lack of swap space is normally temporary; however, a lack of core is not. -Soft limits may be increased to their corresponding hard limits. -.It Bq Er EINVAL -Invalid argument. -Some invalid argument was supplied. -.It Bq Er EAGAIN -Resource temporarily unavailable. -The system-imposed limit on the total -number of processes under execution would be exceeded. -This limit is configuration-dependent. -.It Bq Er EAGAIN -Resource temporarily unavailable. -The system-imposed limit -.Dv MAXUPRC -on the total number of processes under execution by a single user would be -exceeded. -.Dv MAXUPRC -is currently defined in -.Aq Pa sys/param.h -as -.Dv CHILD_MAX , -which is currently defined as 80 in -.Aq Pa sys/syslimits.h . -.It Bq Er ENOTSUP -The -.Dv RFTHREAD -flag was set but the kern.rthreads sysctl was not enabled. -.El -.Sh SEE ALSO -.Xr _exit 2 , -.Xr execve 2 , -.Xr fork 2 , -.Xr intro 2 , -.Xr vfork 2 -.Sh HISTORY -The -.Fn rfork -function first appeared in Plan 9. -.Sh BUGS -.Dv RFTHREAD -cannot be used from C, as the two threads would return on the same stack. |