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 # if @REPLACE_POSIX_SPAWN@
115 /* Use the values from the system, for better compatibility. */
116 /* But this implementation does not support AIX extensions. */
117 # undef POSIX_SPAWN_FORK_HANDLERS
119 # define POSIX_SPAWN_RESETIDS 0x01
120 # define POSIX_SPAWN_SETPGROUP 0x02
121 # define POSIX_SPAWN_SETSIGDEF 0x04
122 # define POSIX_SPAWN_SETSIGMASK 0x08
123 # define POSIX_SPAWN_SETSCHEDPARAM 0x10
124 # define POSIX_SPAWN_SETSCHEDULER 0x20
127 /* A GNU extension. Use the next free bit position. */
128 #define POSIX_SPAWN_USEVFORK \
129 ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
130 | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
131 | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
132 | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
133 | POSIX_SPAWN_SETSCHEDPARAM | (POSIX_SPAWN_SETSCHEDPARAM - 1) \
134 | POSIX_SPAWN_SETSCHEDULER | (POSIX_SPAWN_SETSCHEDULER - 1)) \
136 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
137 [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
138 | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
139 | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
140 & POSIX_SPAWN_USEVFORK) == 0) - 1];
148 #if @GNULIB_POSIX_SPAWN@
149 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
150 Before running the process perform the actions described in FILE-ACTIONS.
152 This function is a possible cancellation points and therefore not
153 marked with __THROW. */
154 # if @REPLACE_POSIX_SPAWN@
155 # define posix_spawn rpl_posix_spawn
157 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
158 extern int posix_spawn (pid_t *_Restrict_ __pid,
159 const char *_Restrict_ __path,
160 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
161 const posix_spawnattr_t *_Restrict_ __attrp,
162 char *const argv[_Restrict_arr_],
163 char *const envp[_Restrict_arr_])
164 _GL_ARG_NONNULL ((2, 5, 6));
166 #elif defined GNULIB_POSIXCHECK
168 # if HAVE_RAW_DECL_POSIX_SPAWN
169 _GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
170 "use gnulib module posix_spawn for portability");
174 #if @GNULIB_POSIX_SPAWNP@
175 /* Similar to `posix_spawn' but search for FILE in the PATH.
177 This function is a possible cancellation points and therefore not
178 marked with __THROW. */
179 # if @REPLACE_POSIX_SPAWN@
180 # define posix_spawnp rpl_posix_spawnp
182 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
183 extern int posix_spawnp (pid_t *__pid, const char *__file,
184 const posix_spawn_file_actions_t *__file_actions,
185 const posix_spawnattr_t *__attrp,
186 char *const argv[], char *const envp[])
187 _GL_ARG_NONNULL ((2, 5, 6));
189 #elif defined GNULIB_POSIXCHECK
191 # if HAVE_RAW_DECL_POSIX_SPAWNP
192 _GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
193 "use gnulib module posix_spawnp for portability");
198 #if @GNULIB_POSIX_SPAWNATTR_INIT@
199 /* Initialize data structure with attributes for `spawn' to default values. */
200 # if @REPLACE_POSIX_SPAWN@
201 # define posix_spawnattr_init rpl_posix_spawnattr_init
203 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
204 extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
205 __THROW _GL_ARG_NONNULL ((1));
207 #elif defined GNULIB_POSIXCHECK
208 # undef posix_spawnattr_init
209 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
210 _GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
211 "use gnulib module posix_spawnattr_init for portability");
215 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
216 /* Free resources associated with ATTR. */
217 # if @REPLACE_POSIX_SPAWN@
218 # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
220 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
221 extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
222 __THROW _GL_ARG_NONNULL ((1));
224 #elif defined GNULIB_POSIXCHECK
225 # undef posix_spawnattr_destroy
226 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
227 _GL_WARN_ON_USE (posix_spawnattr_destroy, "posix_spawnattr_destroy is unportable - "
228 "use gnulib module posix_spawnattr_destroy for portability");
232 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
233 /* Store signal mask for signals with default handling from ATTR in
235 # if @REPLACE_POSIX_SPAWN@
236 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
238 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
239 extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
240 sigset_t *_Restrict_ __sigdefault)
241 __THROW _GL_ARG_NONNULL ((1, 2));
243 #elif defined GNULIB_POSIXCHECK
244 # undef posix_spawnattr_getsigdefault
245 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
246 _GL_WARN_ON_USE (posix_spawnattr_getsigdefault, "posix_spawnattr_getsigdefault is unportable - "
247 "use gnulib module posix_spawnattr_getsigdefault for portability");
251 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
252 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
253 # if @REPLACE_POSIX_SPAWN@
254 # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
256 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
257 extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
258 const sigset_t *_Restrict_ __sigdefault)
259 __THROW _GL_ARG_NONNULL ((1, 2));
261 #elif defined GNULIB_POSIXCHECK
262 # undef posix_spawnattr_setsigdefault
263 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
264 _GL_WARN_ON_USE (posix_spawnattr_setsigdefault, "posix_spawnattr_setsigdefault is unportable - "
265 "use gnulib module posix_spawnattr_setsigdefault for portability");
269 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
270 /* Store signal mask for the new process from ATTR in SIGMASK. */
271 # if @REPLACE_POSIX_SPAWN@
272 # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
274 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
275 extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
276 sigset_t *_Restrict_ __sigmask)
277 __THROW _GL_ARG_NONNULL ((1, 2));
279 #elif defined GNULIB_POSIXCHECK
280 # undef posix_spawnattr_getsigmask
281 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
282 _GL_WARN_ON_USE (posix_spawnattr_getsigmask, "posix_spawnattr_getsigmask is unportable - "
283 "use gnulib module posix_spawnattr_getsigmask for portability");
287 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
288 /* Set signal mask for the new process in ATTR to SIGMASK. */
289 # if @REPLACE_POSIX_SPAWN@
290 # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
292 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
293 extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
294 const sigset_t *_Restrict_ __sigmask)
295 __THROW _GL_ARG_NONNULL ((1, 2));
297 #elif defined GNULIB_POSIXCHECK
298 # undef posix_spawnattr_setsigmask
299 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
300 _GL_WARN_ON_USE (posix_spawnattr_setsigmask, "posix_spawnattr_setsigmask is unportable - "
301 "use gnulib module posix_spawnattr_setsigmask for portability");
305 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
306 /* Get flag word from the attribute structure. */
307 # if @REPLACE_POSIX_SPAWN@
308 # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
310 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
311 extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
312 short int *_Restrict_ __flags)
313 __THROW _GL_ARG_NONNULL ((1, 2));
315 #elif defined GNULIB_POSIXCHECK
316 # undef posix_spawnattr_getflags
317 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
318 _GL_WARN_ON_USE (posix_spawnattr_getflags, "posix_spawnattr_getflags is unportable - "
319 "use gnulib module posix_spawnattr_getflags for portability");
323 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
324 /* Store flags in the attribute structure. */
325 # if @REPLACE_POSIX_SPAWN@
326 # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
328 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
329 extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
331 __THROW _GL_ARG_NONNULL ((1));
333 #elif defined GNULIB_POSIXCHECK
334 # undef posix_spawnattr_setflags
335 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
336 _GL_WARN_ON_USE (posix_spawnattr_setflags, "posix_spawnattr_setflags is unportable - "
337 "use gnulib module posix_spawnattr_setflags for portability");
341 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
342 /* Get process group ID from the attribute structure. */
343 # if @REPLACE_POSIX_SPAWN@
344 # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
346 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
347 extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
348 pid_t *_Restrict_ __pgroup)
349 __THROW _GL_ARG_NONNULL ((1, 2));
351 #elif defined GNULIB_POSIXCHECK
352 # undef posix_spawnattr_getpgroup
353 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
354 _GL_WARN_ON_USE (posix_spawnattr_getpgroup, "posix_spawnattr_getpgroup is unportable - "
355 "use gnulib module posix_spawnattr_getpgroup for portability");
359 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
360 /* Store process group ID in the attribute structure. */
361 # if @REPLACE_POSIX_SPAWN@
362 # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
364 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
365 extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
367 __THROW _GL_ARG_NONNULL ((1));
369 #elif defined GNULIB_POSIXCHECK
370 # undef posix_spawnattr_setpgroup
371 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
372 _GL_WARN_ON_USE (posix_spawnattr_setpgroup, "posix_spawnattr_setpgroup is unportable - "
373 "use gnulib module posix_spawnattr_setpgroup for portability");
377 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
378 /* Get scheduling policy from the attribute structure. */
379 # if @REPLACE_POSIX_SPAWN@
380 # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
382 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
383 extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
384 int *_Restrict_ __schedpolicy)
385 __THROW _GL_ARG_NONNULL ((1, 2));
387 #elif defined GNULIB_POSIXCHECK
388 # undef posix_spawnattr_getschedpolicy
389 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
390 _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy, "posix_spawnattr_getschedpolicy is unportable - "
391 "use gnulib module posix_spawnattr_getschedpolicy for portability");
395 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
396 /* Store scheduling policy in the attribute structure. */
397 # if @REPLACE_POSIX_SPAWN@
398 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
400 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
401 extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
403 __THROW _GL_ARG_NONNULL ((1));
405 #elif defined GNULIB_POSIXCHECK
406 # undef posix_spawnattr_setschedpolicy
407 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
408 _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy, "posix_spawnattr_setschedpolicy is unportable - "
409 "use gnulib module posix_spawnattr_setschedpolicy for portability");
413 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
414 /* Get scheduling parameters from the attribute structure. */
415 # if @REPLACE_POSIX_SPAWN@
416 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
418 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
419 extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
420 struct sched_param *_Restrict_ __schedparam)
421 __THROW _GL_ARG_NONNULL ((1, 2));
423 #elif defined GNULIB_POSIXCHECK
424 # undef posix_spawnattr_getschedparam
425 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
426 _GL_WARN_ON_USE (posix_spawnattr_getschedparam, "posix_spawnattr_getschedparam is unportable - "
427 "use gnulib module posix_spawnattr_getschedparam for portability");
431 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
432 /* Store scheduling parameters in the attribute structure. */
433 # if @REPLACE_POSIX_SPAWN@
434 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
436 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
437 extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
438 const struct sched_param *_Restrict_ __schedparam)
439 __THROW _GL_ARG_NONNULL ((1, 2));
441 #elif defined GNULIB_POSIXCHECK
442 # undef posix_spawnattr_setschedparam
443 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
444 _GL_WARN_ON_USE (posix_spawnattr_setschedparam, "posix_spawnattr_setschedparam is unportable - "
445 "use gnulib module posix_spawnattr_setschedparam for portability");
450 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
451 /* Initialize data structure for file attribute for `spawn' call. */
452 # if @REPLACE_POSIX_SPAWN@
453 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
455 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
456 extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
457 __THROW _GL_ARG_NONNULL ((1));
459 #elif defined GNULIB_POSIXCHECK
460 # undef posix_spawn_file_actions_init
461 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
462 _GL_WARN_ON_USE (posix_spawn_file_actions_init, "posix_spawn_file_actions_init is unportable - "
463 "use gnulib module posix_spawn_file_actions_init for portability");
467 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
468 /* Free resources associated with FILE-ACTIONS. */
469 # if @REPLACE_POSIX_SPAWN@
470 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
472 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
473 extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
474 __THROW _GL_ARG_NONNULL ((1));
476 #elif defined GNULIB_POSIXCHECK
477 # undef posix_spawn_file_actions_destroy
478 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
479 _GL_WARN_ON_USE (posix_spawn_file_actions_destroy, "posix_spawn_file_actions_destroy is unportable - "
480 "use gnulib module posix_spawn_file_actions_destroy for portability");
484 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
485 /* Add an action to FILE-ACTIONS which tells the implementation to call
486 `open' for the given file during the `spawn' call. */
487 # if @REPLACE_POSIX_SPAWN@
488 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
490 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
491 extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions,
493 const char *_Restrict_ __path,
494 int __oflag, mode_t __mode)
495 __THROW _GL_ARG_NONNULL ((1, 3));
497 #elif defined GNULIB_POSIXCHECK
498 # undef posix_spawn_file_actions_addopen
499 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
500 _GL_WARN_ON_USE (posix_spawn_file_actions_addopen, "posix_spawn_file_actions_addopen is unportable - "
501 "use gnulib module posix_spawn_file_actions_addopen for portability");
505 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
506 /* Add an action to FILE-ACTIONS which tells the implementation to call
507 `close' for the given file descriptor during the `spawn' call. */
508 # if @REPLACE_POSIX_SPAWN@
509 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
511 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
512 extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
514 __THROW _GL_ARG_NONNULL ((1));
516 #elif defined GNULIB_POSIXCHECK
517 # undef posix_spawn_file_actions_addclose
518 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
519 _GL_WARN_ON_USE (posix_spawn_file_actions_addclose, "posix_spawn_file_actions_addclose is unportable - "
520 "use gnulib module posix_spawn_file_actions_addclose for portability");
524 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
525 /* Add an action to FILE-ACTIONS which tells the implementation to call
526 `dup2' for the given file descriptors during the `spawn' call. */
527 # if @REPLACE_POSIX_SPAWN@
528 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
530 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
531 extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
532 int __fd, int __newfd)
533 __THROW _GL_ARG_NONNULL ((1));
535 #elif defined GNULIB_POSIXCHECK
536 # undef posix_spawn_file_actions_adddup2
537 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
538 _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2, "posix_spawn_file_actions_adddup2 is unportable - "
539 "use gnulib module posix_spawn_file_actions_adddup2 for portability");
549 #endif /* _GL_SPAWN_H */
550 #endif /* _GL_SPAWN_H */