2 .\" Copyright (c) 2000-2010 Apple Inc. All rights reserved.
4 .\" @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 .\" This file contains Original Code and/or Modifications of Original Code
7 .\" as defined in and that are subject to the Apple Public Source License
8 .\" Version 2.0 (the 'License'). You may not use this file except in
9 .\" compliance with the License. The rights granted to you under the License
10 .\" may not be used to create, or enable the creation or redistribution of,
11 .\" unlawful or unlicensed copies of an Apple operating system, or to
12 .\" circumvent, violate, or enable the circumvention or violation of, any
13 .\" terms of an Apple operating system software license agreement.
15 .\" Please obtain a copy of the License at
16 .\" http://www.opensource.apple.com/apsl/ and read it before using this file.
18 .\" The Original Code and all software distributed under the License are
19 .\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 .\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 .\" Please see the License for the specific language governing rights and
24 .\" limitations under the License.
26 .\" @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 .\" @(#)posix_spawnattr_setflags.3
31 .Dt POSIX_SPAWNATTR_SETFLAGS 3
34 .Nm posix_spawnattr_setflags
35 .Nm posix_spawnattr_getflags
36 .Nd get or set flags on a
39 .Fd #include <spawn.h>
41 .Fo posix_spawnattr_setflags
42 .Fa "posix_spawnattr_t *attr"
46 .Fo posix_spawnattr_getflags
47 .Fa "const posix_spawnattr_t *restrict attr"
48 .Fa "short *restrict flags"
52 .Fn posix_spawnattr_setflags
55 on the attributes object referenced by
59 .Fn posix_spawnattr_getflags
60 function retrieves the
62 on the attributes object referenced by
67 is either 0 or a logical OR of one or more of the following flags:
68 .Bl -tag -width POSIX_SPAWN_START_SUSPENDED
69 .It Dv POSIX_SPAWN_RESETIDS
70 If this bit is set, the child process will inherit the real (rather than the effective) user and
71 group ID of the parent process. NOTE: This flag has no effect when the set-group bit is set on the
72 process image being spawned.
73 .It Dv POSIX_SPAWN_SETPGROUP
74 If this bit is not set, then the child process inherits the parent
75 process group; if it is set, then the child process will behave as if the
77 function had been called with a
81 parameter equal to the value of the spawn-pgroup value of the
82 .Em posix_spawnattr_t ,
84 .Xr posix_spawnattr_setpgroup 3
85 .It Dv POSIX_SPAWN_SETSIGDEF
86 Signals set to to either be caught or to the default action in the
87 parent process will also be set to the default action in the child
88 process. Signals set to be ignored in the parent process will be
89 ignored in the child. However, if this bit is set, then signals in
93 .Em posix_spawnattr_t ,
95 .Xr posix_spawnattr_setsigdefault 3
96 which are caught or ignored in the parent will instead be reset to
97 their default actions in the child.
98 .It Dv POSIX_SPAWN_SETSIGMASK
99 If this bit is set, then the initial signal mask of the child process will
103 .Em posix_spawnattr_t ,
105 .Xr posix_spawnattr_setsigmask 3 .
106 .It Dv POSIX_SPAWN_SETEXEC
107 .Em Apple Extension :
108 If this bit is set, rather than returning to the caller,
112 will behave as a more featureful
114 .It Dv POSIX_SPAWN_START_SUSPENDED
115 .Em Apple Extension :
116 If this bit is set, then the child process will be created with its task
117 suspended, permitting debuggers, profilers, and other programs to
118 manipulate the process before it begins execution in user space. This
119 permits, for example, obtaining exact instruction counts, or debugging
122 .It Dv POSIX_SPAWN_CLOEXEC_DEFAULT
123 .Em Apple Extension :
124 If this bit is set, then only file descriptors explicitly described by the
126 argument are available in the spawned process; all
127 of the other file descriptors are
128 automatically closed in the spawned process.
131 On success, these functions return 0; on failure they return an error
135 .Fn posix_spawnattr_getflags
136 additionally, upon successful completion, modifies the value pointed to be the
138 argument by making it equal to the
141 .Em posix_spawnattr_t .
143 These functions may fail if:
147 The value specified by
159 .Xr posix_spawnattr_init 3 ,
160 .Xr posix_spawnattr_destroy 3 ,
161 .Xr posix_spawnattr_setpgroup 3 ,
162 .Xr posix_spawnattr_setsigdefault 3 ,
163 .Xr posix_spawnattr_setsigmask 3 ,
164 .Xr posix_spawn_file_actions_init 3 ,
172 .Fn posix_spawnattr_setflags
174 .Fn posix_spawnattr_getflags
175 function calls appeared in