.\"
-.\" Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+.\" Copyright (c) 2000-2016 Apple Inc. All rights reserved.
.\"
.\" @APPLE_OSREFERENCE_LICENSE_HEADER_START@
-.\"
+.\"
.\" This file contains Original Code and/or Modifications of Original Code
.\" as defined in and that are subject to the Apple Public Source License
.\" Version 2.0 (the 'License'). You may not use this file except in
.\" unlawful or unlicensed copies of an Apple operating system, or to
.\" circumvent, violate, or enable the circumvention or violation of, any
.\" terms of an Apple operating system software license agreement.
-.\"
+.\"
.\" Please obtain a copy of the License at
.\" http://www.opensource.apple.com/apsl/ and read it before using this file.
-.\"
+.\"
.\" The Original Code and all software distributed under the License are
.\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
.\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
.\" Please see the License for the specific language governing rights and
.\" limitations under the License.
-.\"
+.\"
.\" @APPLE_OSREFERENCE_LICENSE_HEADER_END@
.\"
.\" @(#)posix_spawnattr_setflags.3
.
-.Dd August 22, 2007
+.Dd October 28, 2010
.Dt POSIX_SPAWNATTR_SETFLAGS 3
.Os "Mac OS X"
.Sh NAME
is either 0 or a logical OR of one or more of the following flags:
.Bl -tag -width POSIX_SPAWN_START_SUSPENDED
.It Dv POSIX_SPAWN_RESETIDS
-If the set group bit is set on the process image being spawned, this
-bit has no effect; otherwise, if not set, the child process will
-inherit the effective group ID of the parent process, and if set, the
-child process will inherit the real group ID of the parent process.
+If this bit is set, the child process will inherit the real (rather than the effective) user and
+group ID of the parent process. NOTE: This flag has no effect when the set-group bit is set on the
+process image being spawned.
.It Dv POSIX_SPAWN_SETPGROUP
If this bit is not set, then the child process inherits the parent
-process group; if set, then the child process shall behave as if the
+process group; if it is set, then the child process will behave as if the
.Xr setpgid 2
function had been called with a
.Fa pid
as set by
.Xr posix_spawnattr_setpgroup 3
.It Dv POSIX_SPAWN_SETSIGDEF
-Signals set to to either be caught or to the default action in the
+Signals set to either be caught or to the default action in the
parent process will also be set to the default action in the child
process. Signals set to be ignored in the parent process will be
ignored in the child. However, if this bit is set, then signals in
.Xr execve 2 .
.It Dv POSIX_SPAWN_START_SUSPENDED
.Em Apple Extension :
-If this bit is set, then the child process will be created with its task
-suspended, permitting debuggers, profilers, and other programs to
-manipulate the process before it begins execution in user space. This
-permits, for example, obtaining exact instruction counts, or debugging
-very early in
+If this bit is set, then the child process will be created as if it immediately
+received a
+.Li SIGSTOP
+signal, permitting debuggers, profilers, and other programs to manipulate the
+process before it begins execution in user space. This permits, for example,
+obtaining exact instruction counts, or debugging very early in
.Xr dyld 1 .
+To resume the child process, it must be sent a
+.Li SIGCONT
+signal.
+.It Dv POSIX_SPAWN_CLOEXEC_DEFAULT
+.Em Apple Extension :
+If this bit is set, then only file descriptors explicitly described by the
+.Fa file_actions
+argument are available in the spawned process; all of the other file descriptors
+are automatically closed in the spawned process.
.El
.Sh RETURN VALUES
-On success, these functions return 0; on failure they return an error
-number from
+On success, these functions return 0; on failure they return an error number
+from
.In errno.h .
The
.Fn posix_spawnattr_getflags
-additionally, upon successful completion, modifies the value pointed to be the
-.Fa attr
-argument by making it equal to the
+function additionally, upon successful completion, makes the value pointed to by
+the
+.Fa flags
+argument equal to the
.Em spawn-flags
attribute of the
.Em posix_spawnattr_t .
.Xr posix_spawnattr_setpgroup 3 ,
.Xr posix_spawnattr_setsigdefault 3 ,
.Xr posix_spawnattr_setsigmask 3 ,
+.Xr posix_spawn_file_actions_init 3 ,
.Xr setpgid 2 ,
+.Xr signal 3 ,
.Xr execve 2 ,
.Xr dyld 1
.Sh STANDARDS