]>
Commit | Line | Data |
---|---|---|
39236c6e A |
1 | /* |
2 | * Copyright (c) 2006, 2010 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
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. Please obtain a copy of the License at | |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
11 | * file. | |
12 | * | |
13 | * The Original Code and all software distributed under the License are | |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
18 | * Please see the License for the specific language governing rights and | |
19 | * limitations under the License. | |
20 | * | |
21 | * @APPLE_LICENSE_HEADER_END@ | |
22 | */ | |
23 | ||
24 | ||
25 | #ifndef _SPAWN_H_ | |
26 | #define _SPAWN_H_ | |
27 | ||
28 | /* | |
29 | * [SPN] Support for _POSIX_SPAWN | |
30 | */ | |
31 | ||
3e170ce0 | 32 | #include <sys/cdefs.h> |
39236c6e | 33 | #include <_types.h> |
3e170ce0 | 34 | #include <sys/spawn.h> /* shared types */ |
39236c6e A |
35 | |
36 | #include <Availability.h> | |
37 | ||
38 | /* | |
39 | * [SPN] Inclusion of the <spawn.h> header may make visible symbols defined | |
40 | * in the <sched.h>, <signal.h>, and <sys/types.h> headers. | |
41 | */ | |
42 | #include <sys/_types/_pid_t.h> | |
43 | #include <sys/_types/_sigset_t.h> | |
44 | #include <sys/_types/_mode_t.h> | |
45 | ||
46 | /* | |
47 | * Opaque types for use with posix_spawn() family functions. Internals are | |
48 | * not defined, and should not be accessed directly. Types are defined as | |
49 | * mandated by POSIX. | |
50 | */ | |
51 | typedef void *posix_spawnattr_t; | |
52 | typedef void *posix_spawn_file_actions_t; | |
53 | ||
54 | __BEGIN_DECLS | |
55 | /* | |
56 | * gcc under c99 mode won't compile "[ __restrict]" by itself. As a workaround, | |
57 | * a dummy argument name is added. | |
58 | */ | |
3e170ce0 A |
59 | |
60 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
61 | int posix_spawn(pid_t * __restrict, const char * __restrict, |
62 | const posix_spawn_file_actions_t *, | |
63 | const posix_spawnattr_t * __restrict, | |
64 | char *const __argv[ __restrict], | |
65 | char *const __envp[ __restrict]) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
66 | |
67 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
68 | int posix_spawnp(pid_t * __restrict, const char * __restrict, |
69 | const posix_spawn_file_actions_t *, | |
70 | const posix_spawnattr_t * __restrict, | |
71 | char *const __argv[ __restrict], | |
72 | char *const __envp[ __restrict]) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
73 | |
74 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 75 | int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
76 | |
77 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
78 | int posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *, int, |
79 | int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
80 | |
81 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
82 | int posix_spawn_file_actions_addopen( |
83 | posix_spawn_file_actions_t * __restrict, int, | |
84 | const char * __restrict, int, mode_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
85 | |
86 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 87 | int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
88 | |
89 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 90 | int posix_spawn_file_actions_init(posix_spawn_file_actions_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
91 | |
92 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 93 | int posix_spawnattr_destroy(posix_spawnattr_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
94 | |
95 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
96 | int posix_spawnattr_getsigdefault(const posix_spawnattr_t * __restrict, |
97 | sigset_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
98 | |
99 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
100 | int posix_spawnattr_getflags(const posix_spawnattr_t * __restrict, |
101 | short * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
102 | |
103 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
104 | int posix_spawnattr_getpgroup(const posix_spawnattr_t * __restrict, |
105 | pid_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
106 | |
107 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
108 | int posix_spawnattr_getsigmask(const posix_spawnattr_t * __restrict, |
109 | sigset_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
110 | |
111 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 112 | int posix_spawnattr_init(posix_spawnattr_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
113 | |
114 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
115 | int posix_spawnattr_setsigdefault(posix_spawnattr_t * __restrict, |
116 | const sigset_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
117 | |
118 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 119 | int posix_spawnattr_setflags(posix_spawnattr_t *, short) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
120 | |
121 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e | 122 | int posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); |
3e170ce0 A |
123 | |
124 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
125 | int posix_spawnattr_setsigmask(posix_spawnattr_t * __restrict, |
126 | const sigset_t * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
127 | ||
128 | #if 0 /* _POSIX_PRIORITY_SCHEDULING [PS] : not supported */ | |
129 | int posix_spawnattr_setschedparam(posix_spawnattr_t * __restrict, | |
130 | const struct sched_param * __restrict); | |
131 | int posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int); | |
132 | int posix_spawnattr_getschedparam(const posix_spawnattr_t * __restrict, | |
133 | struct sched_param * __restrict); | |
134 | int posix_spawnattr_getschedpolicy(const posix_spawnattr_t * __restrict, | |
135 | int * __restrict); | |
136 | #endif /* 0 */ | |
137 | ||
138 | __END_DECLS | |
139 | ||
140 | #if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) | |
141 | /* | |
142 | * Darwin-specific extensions below | |
143 | */ | |
144 | #include <mach/exception_types.h> | |
145 | #include <mach/machine.h> | |
146 | #include <mach/port.h> | |
147 | ||
148 | #include <sys/_types/_size_t.h> | |
149 | ||
150 | __BEGIN_DECLS | |
151 | ||
3e170ce0 | 152 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED |
39236c6e A |
153 | int posix_spawnattr_getbinpref_np(const posix_spawnattr_t * __restrict, |
154 | size_t, cpu_type_t *__restrict, size_t *__restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
155 | |
156 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
157 | int posix_spawnattr_setauditsessionport_np(posix_spawnattr_t *__restrict, |
158 | mach_port_t) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2); | |
3e170ce0 A |
159 | |
160 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
161 | int posix_spawnattr_setbinpref_np(posix_spawnattr_t * __restrict, |
162 | size_t, cpu_type_t *__restrict, size_t *__restrict) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
163 | |
164 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
165 | int posix_spawnattr_setexceptionports_np(posix_spawnattr_t *__restrict, |
166 | exception_mask_t, mach_port_t, | |
167 | exception_behavior_t, thread_state_flavor_t) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
168 | |
169 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
170 | int posix_spawnattr_setspecialport_np(posix_spawnattr_t *__restrict, |
171 | mach_port_t, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); | |
3e170ce0 A |
172 | |
173 | __WATCHOS_PROHIBITED __TVOS_PROHIBITED | |
39236c6e A |
174 | int posix_spawn_file_actions_addinherit_np(posix_spawn_file_actions_t *, |
175 | int) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3); | |
176 | ||
177 | __END_DECLS | |
178 | ||
179 | #endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */ | |
180 | #endif /* _SPAWN_H_ */ |