1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_FORK_H 28 #define _SYS_FORK_H 29 30 #include <sys/types.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 37 38 #if !defined(_KERNEL) 39 40 extern pid_t forkx(int); 41 extern pid_t forkallx(int); 42 extern pid_t vforkx(int) __RETURNS_TWICE; 43 44 #endif /* !defined(_KERNEL) */ 45 46 /* 47 * The argument to any of the forkx() functions is a set of flags 48 * formed by or-ing together zero or more of the following flags. 49 * fork()/forkall()/vfork() are equivalent to the corresponding 50 * forkx()/forkallx()/vforkx() functions with a zero argument. 51 */ 52 53 /* 54 * Do not post a SIGCHLD signal to the parent when the child terminates, 55 * regardless of the disposition of the SIGCHLD signal in the parent. 56 * SIGCHLD signals are still possible for job control stop and continue 57 * actions (CLD_STOPPED, CLD_CONTINUED) if the parent has requested them. 58 */ 59 #define FORK_NOSIGCHLD 0x0001 60 61 /* 62 * Do not allow wait-for-multiple-pids by the parent, as in waitid(P_ALL) 63 * or waitid(P_PGID), to reap the child and do not allow the child to 64 * be reaped automatically due the disposition of the SIGCHLD signal 65 * being set to be ignored. Only a specific wait for the child, as 66 * in waitid(P_PID, pid), is allowed and it is required, else when 67 * the child exits it will remain a zombie until the parent exits. 68 */ 69 #define FORK_WAITPID 0x0002 70 71 #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif /* _SYS_FORK_H */ 78