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