xref: /illumos-gate/usr/src/uts/common/sys/spawn.h (revision ac2250cb76bb32944fd2c8a3ba2cd3f79747748d)
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 /*
28  * Copyright 2026 Oxide Computer Company
29  */
30 
31 #ifndef _SYS_SPAWN_H
32 #define	_SYS_SPAWN_H
33 
34 /*
35  * Public, application-visible definitions for the posix_spawn(3C) family
36  * that the kernel must also see. They are exposed to applications through
37  * <spawn.h> and are consumed by the private spawn(2) system call that libc
38  * uses to implement the family, so they sit in their own header that both
39  * can include. The private libc/kernel marshalling contract lives in
40  * <sys/spawn_impl.h>.
41  */
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 /*
48  * flags for posix_spawnattr_setflags()
49  */
50 #define	POSIX_SPAWN_RESETIDS		0x0001
51 #define	POSIX_SPAWN_SETPGROUP		0x0002
52 #define	POSIX_SPAWN_SETSIGDEF		0x0004
53 #define	POSIX_SPAWN_SETSIGMASK		0x0008
54 #define	POSIX_SPAWN_SETSCHEDPARAM	0x0010
55 #define	POSIX_SPAWN_SETSCHEDULER	0x0020
56 #define	POSIX_SPAWN_SETSID		0x0040
57 /*
58  * non-portable extensions
59  */
60 #if !defined(_STRICT_POSIX) || defined(_KERNEL)
61 #define	POSIX_SPAWN_SETSIGIGN_NP	0x0800
62 #define	POSIX_SPAWN_NOSIGCHLD_NP	0x1000
63 #define	POSIX_SPAWN_WAITPID_NP		0x2000
64 #define	POSIX_SPAWN_NOEXECERR_NP	0x4000
65 #endif	/* !_STRICT_POSIX || defined(_KERNEL) */
66 
67 #ifdef	__cplusplus
68 }
69 #endif
70 
71 #endif	/* _SYS_SPAWN_H */
72