13235Sraf /* 23235Sraf * CDDL HEADER START 33235Sraf * 43235Sraf * The contents of this file are subject to the terms of the 53235Sraf * Common Development and Distribution License (the "License"). 63235Sraf * You may not use this file except in compliance with the License. 73235Sraf * 83235Sraf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93235Sraf * or http://www.opensolaris.org/os/licensing. 103235Sraf * See the License for the specific language governing permissions 113235Sraf * and limitations under the License. 123235Sraf * 133235Sraf * When distributing Covered Code, include this CDDL HEADER in each 143235Sraf * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153235Sraf * If applicable, add the following below this CDDL HEADER, with the 163235Sraf * fields enclosed by brackets "[]" replaced with your own identifying 173235Sraf * information: Portions Copyright [yyyy] [name of copyright owner] 183235Sraf * 193235Sraf * CDDL HEADER END 203235Sraf */ 213235Sraf 223235Sraf /* 23*10776SRoger.Faulkner@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 243235Sraf * Use is subject to license terms. 253235Sraf */ 263235Sraf 273235Sraf #ifndef _SYS_FORK_H 283235Sraf #define _SYS_FORK_H 293235Sraf 303235Sraf #include <sys/types.h> 313235Sraf 323235Sraf #ifdef __cplusplus 333235Sraf extern "C" { 343235Sraf #endif 353235Sraf 363235Sraf #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 373235Sraf 383235Sraf #if !defined(_KERNEL) 393235Sraf 403235Sraf extern pid_t forkx(int); 413235Sraf extern pid_t forkallx(int); 423235Sraf extern pid_t vforkx(int); 433235Sraf 443235Sraf #pragma unknown_control_flow(vforkx) 453235Sraf 463235Sraf #endif /* !defined(_KERNEL) */ 473235Sraf 483235Sraf /* 493235Sraf * The argument to any of the forkx() functions is a set of flags 503235Sraf * formed by or-ing together zero or more of the following flags. 513235Sraf * fork()/forkall()/vfork() are equivalent to the corresponding 523235Sraf * forkx()/forkallx()/vforkx() functions with a zero argument. 533235Sraf */ 543235Sraf 553235Sraf /* 563235Sraf * Do not post a SIGCHLD signal to the parent when the child terminates, 573235Sraf * regardless of the disposition of the SIGCHLD signal in the parent. 583235Sraf * SIGCHLD signals are still possible for job control stop and continue 593235Sraf * actions (CLD_STOPPED, CLD_CONTINUED) if the parent has requested them. 603235Sraf */ 613235Sraf #define FORK_NOSIGCHLD 0x0001 623235Sraf 633235Sraf /* 643235Sraf * Do not allow wait-for-multiple-pids by the parent, as in waitid(P_ALL) 653235Sraf * or waitid(P_PGID), to reap the child and do not allow the child to 663235Sraf * be reaped automatically due the disposition of the SIGCHLD signal 673235Sraf * being set to be ignored. Only a specific wait for the child, as 683235Sraf * in waitid(P_PID, pid), is allowed and it is required, else when 693235Sraf * the child exits it will remain a zombie until the parent exits. 703235Sraf */ 713235Sraf #define FORK_WAITPID 0x0002 723235Sraf 733235Sraf #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 743235Sraf 753235Sraf #ifdef __cplusplus 763235Sraf } 773235Sraf #endif 783235Sraf 793235Sraf #endif /* _SYS_FORK_H */ 80