2 .\" Copyright (c) 2000-2007 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_spawn_file_actions_addclose.3
31 .Dt POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 3
34 .Nm posix_spawn_file_actions_addclose
35 .Nm posix_spawn_file_actions_addopen
36 .Nd add open or close actions to a
37 .Em posix_spawn_file_actions_t
39 .Fd #include <spawn.h>
41 .Fo posix_spawn_file_actions_addclose
42 .Fa "posix_spawn_file_actions_t *file_actions"
46 .Fo posix_spawn_file_actions_addopen
47 .Fa "posix_spawn_file_actions_t *restrict file_actions"
49 .Fa "const char *restrict path"
54 .Fo posix_spawn_file_actions_adddup2
55 .Fa "posix_spawn_file_actions_t *file_actions"
61 .Fn posix_spawn_file_actions_addclose
62 function adds a close operation to the list of operations associated with
63 the object referenced by
65 for subsequent use in a call to
69 The descriptor referred to by
73 had been called on it prior to the new child process
77 .Fn posix_spawn_file_actions_addopen
78 function adds an open operation to the list of operations associated with
79 the object referenced by
81 for subsequent use in a call to
85 The descriptor referred to by
94 had been called on it prior to the new child process
95 starting execution. The string
98 .Fn posix_spawn_file_actions_addopen
99 function during this process, so storage need not be persistent in the
103 .Fn posix_spawn_file_actions_adddup2
104 function adds a dup2 operation to the list of operations associated with
105 the object referenced by
107 for subsequent use in a call to
111 The descriptor referred to by
117 prior to the new child process starting execution.
119 On success, these functions return 0; on failure they return an error
123 These functions may fail if:
127 The value specified by
129 is negative or would cause the process to exceed the maximum number of
130 open files it is allowed..
138 Insufficient memory was available eo add to the
144 .Xr posix_spawn_file_actions_init 3 ,
145 .Xr posix_spawn_file_actions_destroy 3 ,
150 .Fn posix_spawn_file_actions_init
152 .Fn posix_spawn_file_actions_destroy
153 function calls appeared in