1 /* Definitions for POSIX spawn interface.
2 Copyright (C) 2000, 2003-2004, 2008-2010 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 @PRAGMA_SYSTEM_HEADER@
24 /* The include_next requires a split double-inclusion guard. */
26 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
32 /* Get definitions of 'struct sched_param' and 'sigset_t'.
33 But avoid namespace pollution on glibc systems. */
39 #include <sys/types.h>
45 /* GCC 2.95 and later have "__restrict"; C99 compilers have
46 "restrict", and "configure" may have defined "restrict".
47 Other compilers use __restrict, __restrict__, and _Restrict, and
48 'configure' might #define 'restrict' to those words, so pick a
51 # if 199901L <= __STDC_VERSION__
52 # define _Restrict_ restrict
53 # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
54 # define _Restrict_ __restrict
59 /* gcc 3.1 and up support the [restrict] syntax. Don't trust
60 sys/cdefs.h's definition of __restrict_arr, though, as it
61 mishandles gcc -ansi -pedantic. */
62 #ifndef _Restrict_arr_
63 # if ((199901L <= __STDC_VERSION__ \
64 || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
65 && !__STRICT_ANSI__)) \
67 # define _Restrict_arr_ _Restrict_
69 # define _Restrict_arr_
73 /* The definition of _GL_ARG_NONNULL is copied here. */
75 /* The definition of _GL_WARN_ON_USE is copied here. */
78 /* Data structure to contain attributes for thread creation. */
79 #if @REPLACE_POSIX_SPAWN@
80 # define posix_spawnattr_t rpl_posix_spawnattr_t
82 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
89 struct sched_param _sp;
96 /* Data structure to contain information about the actions to be
97 performed in the new process with respect to file descriptors. */
98 #if @REPLACE_POSIX_SPAWN@
99 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
101 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
106 struct __spawn_action *_actions;
108 } posix_spawn_file_actions_t;
112 /* Flags to be set in the `posix_spawnattr_t'. */
113 #if @HAVE_POSIX_SPAWN@
114 /* Use the values from the system, but provide the missing ones. */
115 # ifndef POSIX_SPAWN_SETSCHEDPARAM
116 # define POSIX_SPAWN_SETSCHEDPARAM 0
118 # ifndef POSIX_SPAWN_SETSCHEDULER
119 # define POSIX_SPAWN_SETSCHEDULER 0
122 # if @REPLACE_POSIX_SPAWN@
123 /* Use the values from the system, for better compatibility. */
124 /* But this implementation does not support AIX extensions. */
125 # undef POSIX_SPAWN_FORK_HANDLERS
127 # define POSIX_SPAWN_RESETIDS 0x01
128 # define POSIX_SPAWN_SETPGROUP 0x02
129 # define POSIX_SPAWN_SETSIGDEF 0x04
130 # define POSIX_SPAWN_SETSIGMASK 0x08
131 # define POSIX_SPAWN_SETSCHEDPARAM 0x10
132 # define POSIX_SPAWN_SETSCHEDULER 0x20
135 /* A GNU extension. Use the next free bit position. */
136 #define POSIX_SPAWN_USEVFORK \
137 ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
138 | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
139 | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
140 | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
141 | POSIX_SPAWN_SETSCHEDPARAM \
142 | (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
143 | POSIX_SPAWN_SETSCHEDULER \
144 | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
146 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
147 [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
148 | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
149 | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
150 & POSIX_SPAWN_USEVFORK) == 0) - 1];
158 #if @GNULIB_POSIX_SPAWN@
159 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
160 Before running the process perform the actions described in FILE-ACTIONS.
162 This function is a possible cancellation points and therefore not
163 marked with __THROW. */
164 # if @REPLACE_POSIX_SPAWN@
165 # define posix_spawn rpl_posix_spawn
167 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
168 extern int posix_spawn (pid_t *_Restrict_ __pid,
169 const char *_Restrict_ __path,
170 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
171 const posix_spawnattr_t *_Restrict_ __attrp,
172 char *const argv[_Restrict_arr_],
173 char *const envp[_Restrict_arr_])
174 _GL_ARG_NONNULL ((2, 5, 6));
176 #elif defined GNULIB_POSIXCHECK
178 # if HAVE_RAW_DECL_POSIX_SPAWN
179 _GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
180 "use gnulib module posix_spawn for portability");
184 #if @GNULIB_POSIX_SPAWNP@
185 /* Similar to `posix_spawn' but search for FILE in the PATH.
187 This function is a possible cancellation points and therefore not
188 marked with __THROW. */
189 # if @REPLACE_POSIX_SPAWN@
190 # define posix_spawnp rpl_posix_spawnp
192 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
193 extern int posix_spawnp (pid_t *__pid, const char *__file,
194 const posix_spawn_file_actions_t *__file_actions,
195 const posix_spawnattr_t *__attrp,
196 char *const argv[], char *const envp[])
197 _GL_ARG_NONNULL ((2, 5, 6));
199 #elif defined GNULIB_POSIXCHECK
201 # if HAVE_RAW_DECL_POSIX_SPAWNP
202 _GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
203 "use gnulib module posix_spawnp for portability");
208 #if @GNULIB_POSIX_SPAWNATTR_INIT@
209 /* Initialize data structure with attributes for `spawn' to default values. */
210 # if @REPLACE_POSIX_SPAWN@
211 # define posix_spawnattr_init rpl_posix_spawnattr_init
213 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
214 extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
215 __THROW _GL_ARG_NONNULL ((1));
217 #elif defined GNULIB_POSIXCHECK
218 # undef posix_spawnattr_init
219 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
220 _GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
221 "use gnulib module posix_spawnattr_init for portability");
225 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
226 /* Free resources associated with ATTR. */
227 # if @REPLACE_POSIX_SPAWN@
228 # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
230 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
231 extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
232 __THROW _GL_ARG_NONNULL ((1));
234 #elif defined GNULIB_POSIXCHECK
235 # undef posix_spawnattr_destroy
236 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
237 _GL_WARN_ON_USE (posix_spawnattr_destroy, "posix_spawnattr_destroy is unportable - "
238 "use gnulib module posix_spawnattr_destroy for portability");
242 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
243 /* Store signal mask for signals with default handling from ATTR in
245 # if @REPLACE_POSIX_SPAWN@
246 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
248 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
249 extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
250 sigset_t *_Restrict_ __sigdefault)
251 __THROW _GL_ARG_NONNULL ((1, 2));
253 #elif defined GNULIB_POSIXCHECK
254 # undef posix_spawnattr_getsigdefault
255 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
256 _GL_WARN_ON_USE (posix_spawnattr_getsigdefault, "posix_spawnattr_getsigdefault is unportable - "
257 "use gnulib module posix_spawnattr_getsigdefault for portability");
261 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
262 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
263 # if @REPLACE_POSIX_SPAWN@
264 # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
266 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
267 extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
268 const sigset_t *_Restrict_ __sigdefault)
269 __THROW _GL_ARG_NONNULL ((1, 2));
271 #elif defined GNULIB_POSIXCHECK
272 # undef posix_spawnattr_setsigdefault
273 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
274 _GL_WARN_ON_USE (posix_spawnattr_setsigdefault, "posix_spawnattr_setsigdefault is unportable - "
275 "use gnulib module posix_spawnattr_setsigdefault for portability");
279 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
280 /* Store signal mask for the new process from ATTR in SIGMASK. */
281 # if @REPLACE_POSIX_SPAWN@
282 # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
284 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
285 extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
286 sigset_t *_Restrict_ __sigmask)
287 __THROW _GL_ARG_NONNULL ((1, 2));
289 #elif defined GNULIB_POSIXCHECK
290 # undef posix_spawnattr_getsigmask
291 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
292 _GL_WARN_ON_USE (posix_spawnattr_getsigmask, "posix_spawnattr_getsigmask is unportable - "
293 "use gnulib module posix_spawnattr_getsigmask for portability");
297 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
298 /* Set signal mask for the new process in ATTR to SIGMASK. */
299 # if @REPLACE_POSIX_SPAWN@
300 # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
302 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
303 extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
304 const sigset_t *_Restrict_ __sigmask)
305 __THROW _GL_ARG_NONNULL ((1, 2));
307 #elif defined GNULIB_POSIXCHECK
308 # undef posix_spawnattr_setsigmask
309 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
310 _GL_WARN_ON_USE (posix_spawnattr_setsigmask, "posix_spawnattr_setsigmask is unportable - "
311 "use gnulib module posix_spawnattr_setsigmask for portability");
315 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
316 /* Get flag word from the attribute structure. */
317 # if @REPLACE_POSIX_SPAWN@
318 # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
320 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
321 extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
322 short int *_Restrict_ __flags)
323 __THROW _GL_ARG_NONNULL ((1, 2));
325 #elif defined GNULIB_POSIXCHECK
326 # undef posix_spawnattr_getflags
327 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
328 _GL_WARN_ON_USE (posix_spawnattr_getflags, "posix_spawnattr_getflags is unportable - "
329 "use gnulib module posix_spawnattr_getflags for portability");
333 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
334 /* Store flags in the attribute structure. */
335 # if @REPLACE_POSIX_SPAWN@
336 # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
338 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
339 extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
341 __THROW _GL_ARG_NONNULL ((1));
343 #elif defined GNULIB_POSIXCHECK
344 # undef posix_spawnattr_setflags
345 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
346 _GL_WARN_ON_USE (posix_spawnattr_setflags, "posix_spawnattr_setflags is unportable - "
347 "use gnulib module posix_spawnattr_setflags for portability");
351 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
352 /* Get process group ID from the attribute structure. */
353 # if @REPLACE_POSIX_SPAWN@
354 # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
356 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
357 extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
358 pid_t *_Restrict_ __pgroup)
359 __THROW _GL_ARG_NONNULL ((1, 2));
361 #elif defined GNULIB_POSIXCHECK
362 # undef posix_spawnattr_getpgroup
363 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
364 _GL_WARN_ON_USE (posix_spawnattr_getpgroup, "posix_spawnattr_getpgroup is unportable - "
365 "use gnulib module posix_spawnattr_getpgroup for portability");
369 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
370 /* Store process group ID in the attribute structure. */
371 # if @REPLACE_POSIX_SPAWN@
372 # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
374 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
375 extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
377 __THROW _GL_ARG_NONNULL ((1));
379 #elif defined GNULIB_POSIXCHECK
380 # undef posix_spawnattr_setpgroup
381 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
382 _GL_WARN_ON_USE (posix_spawnattr_setpgroup, "posix_spawnattr_setpgroup is unportable - "
383 "use gnulib module posix_spawnattr_setpgroup for portability");
387 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
388 /* Get scheduling policy from the attribute structure. */
389 # if @REPLACE_POSIX_SPAWN@
390 # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
392 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
393 extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
394 int *_Restrict_ __schedpolicy)
395 __THROW _GL_ARG_NONNULL ((1, 2));
397 #elif defined GNULIB_POSIXCHECK
398 # undef posix_spawnattr_getschedpolicy
399 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
400 _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy, "posix_spawnattr_getschedpolicy is unportable - "
401 "use gnulib module posix_spawnattr_getschedpolicy for portability");
405 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
406 /* Store scheduling policy in the attribute structure. */
407 # if @REPLACE_POSIX_SPAWN@
408 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
410 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
411 extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
413 __THROW _GL_ARG_NONNULL ((1));
415 #elif defined GNULIB_POSIXCHECK
416 # undef posix_spawnattr_setschedpolicy
417 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
418 _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy, "posix_spawnattr_setschedpolicy is unportable - "
419 "use gnulib module posix_spawnattr_setschedpolicy for portability");
423 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
424 /* Get scheduling parameters from the attribute structure. */
425 # if @REPLACE_POSIX_SPAWN@
426 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
428 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
429 extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
430 struct sched_param *_Restrict_ __schedparam)
431 __THROW _GL_ARG_NONNULL ((1, 2));
433 #elif defined GNULIB_POSIXCHECK
434 # undef posix_spawnattr_getschedparam
435 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
436 _GL_WARN_ON_USE (posix_spawnattr_getschedparam, "posix_spawnattr_getschedparam is unportable - "
437 "use gnulib module posix_spawnattr_getschedparam for portability");
441 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
442 /* Store scheduling parameters in the attribute structure. */
443 # if @REPLACE_POSIX_SPAWN@
444 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
446 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
447 extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
448 const struct sched_param *_Restrict_ __schedparam)
449 __THROW _GL_ARG_NONNULL ((1, 2));
451 #elif defined GNULIB_POSIXCHECK
452 # undef posix_spawnattr_setschedparam
453 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
454 _GL_WARN_ON_USE (posix_spawnattr_setschedparam, "posix_spawnattr_setschedparam is unportable - "
455 "use gnulib module posix_spawnattr_setschedparam for portability");
460 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
461 /* Initialize data structure for file attribute for `spawn' call. */
462 # if @REPLACE_POSIX_SPAWN@
463 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
465 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
466 extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
467 __THROW _GL_ARG_NONNULL ((1));
469 #elif defined GNULIB_POSIXCHECK
470 # undef posix_spawn_file_actions_init
471 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
472 _GL_WARN_ON_USE (posix_spawn_file_actions_init, "posix_spawn_file_actions_init is unportable - "
473 "use gnulib module posix_spawn_file_actions_init for portability");
477 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
478 /* Free resources associated with FILE-ACTIONS. */
479 # if @REPLACE_POSIX_SPAWN@
480 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
482 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
483 extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
484 __THROW _GL_ARG_NONNULL ((1));
486 #elif defined GNULIB_POSIXCHECK
487 # undef posix_spawn_file_actions_destroy
488 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
489 _GL_WARN_ON_USE (posix_spawn_file_actions_destroy, "posix_spawn_file_actions_destroy is unportable - "
490 "use gnulib module posix_spawn_file_actions_destroy for portability");
494 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
495 /* Add an action to FILE-ACTIONS which tells the implementation to call
496 `open' for the given file during the `spawn' call. */
497 # if @REPLACE_POSIX_SPAWN@
498 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
500 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
501 extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions,
503 const char *_Restrict_ __path,
504 int __oflag, mode_t __mode)
505 __THROW _GL_ARG_NONNULL ((1, 3));
507 #elif defined GNULIB_POSIXCHECK
508 # undef posix_spawn_file_actions_addopen
509 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
510 _GL_WARN_ON_USE (posix_spawn_file_actions_addopen, "posix_spawn_file_actions_addopen is unportable - "
511 "use gnulib module posix_spawn_file_actions_addopen for portability");
515 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
516 /* Add an action to FILE-ACTIONS which tells the implementation to call
517 `close' for the given file descriptor during the `spawn' call. */
518 # if @REPLACE_POSIX_SPAWN@
519 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
521 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
522 extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
524 __THROW _GL_ARG_NONNULL ((1));
526 #elif defined GNULIB_POSIXCHECK
527 # undef posix_spawn_file_actions_addclose
528 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
529 _GL_WARN_ON_USE (posix_spawn_file_actions_addclose, "posix_spawn_file_actions_addclose is unportable - "
530 "use gnulib module posix_spawn_file_actions_addclose for portability");
534 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
535 /* Add an action to FILE-ACTIONS which tells the implementation to call
536 `dup2' for the given file descriptors during the `spawn' call. */
537 # if @REPLACE_POSIX_SPAWN@
538 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
540 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
541 extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
542 int __fd, int __newfd)
543 __THROW _GL_ARG_NONNULL ((1));
545 #elif defined GNULIB_POSIXCHECK
546 # undef posix_spawn_file_actions_adddup2
547 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
548 _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2, "posix_spawn_file_actions_adddup2 is unportable - "
549 "use gnulib module posix_spawn_file_actions_adddup2 for portability");
559 #endif /* _GL_SPAWN_H */
560 #endif /* _GL_SPAWN_H */