1 /* Definitions for POSIX spawn interface.
2 Copyright (C) 2000, 2003, 2004, 2008-2009 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_LINK_WARNING is copied here. */
75 /* The definition of _GL_ARG_NONNULL 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 @REPLACE_POSIX_SPAWN@
114 /* Use the values from the system, for better compatibility. */
115 /* But this implementation does not support AIX extensions. */
116 # undef POSIX_SPAWN_FORK_HANDLERS
118 # define POSIX_SPAWN_RESETIDS 0x01
119 # define POSIX_SPAWN_SETPGROUP 0x02
120 # define POSIX_SPAWN_SETSIGDEF 0x04
121 # define POSIX_SPAWN_SETSIGMASK 0x08
122 # define POSIX_SPAWN_SETSCHEDPARAM 0x10
123 # define POSIX_SPAWN_SETSCHEDULER 0x20
125 /* A GNU extension. Use the next free bit position. */
126 #define POSIX_SPAWN_USEVFORK \
127 ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
128 | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
129 | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
130 | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
131 | POSIX_SPAWN_SETSCHEDPARAM | (POSIX_SPAWN_SETSCHEDPARAM - 1) \
132 | POSIX_SPAWN_SETSCHEDULER | (POSIX_SPAWN_SETSCHEDULER - 1)) \
134 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
135 [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
136 | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
137 | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
138 & POSIX_SPAWN_USEVFORK) == 0) - 1];
146 #if @GNULIB_POSIX_SPAWN@
147 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
148 Before running the process perform the actions described in FILE-ACTIONS.
150 This function is a possible cancellation points and therefore not
151 marked with __THROW. */
152 # if @REPLACE_POSIX_SPAWN@
153 # define posix_spawn rpl_posix_spawn
155 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
156 extern int posix_spawn (pid_t *_Restrict_ __pid,
157 const char *_Restrict_ __path,
158 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
159 const posix_spawnattr_t *_Restrict_ __attrp,
160 char *const argv[_Restrict_arr_],
161 char *const envp[_Restrict_arr_])
162 _GL_ARG_NONNULL ((2, 5, 6));
164 #elif defined GNULIB_POSIXCHECK
166 # define posix_spawn(a,b,c,d,e,f) \
167 (GL_LINK_WARNING ("posix_spawn is unportable - " \
168 "use gnulib module posix_spawn for portability"), \
169 posix_spawn (a, b, c, d, e, f))
172 #if @GNULIB_POSIX_SPAWNP@
173 /* Similar to `posix_spawn' but search for FILE in the PATH.
175 This function is a possible cancellation points and therefore not
176 marked with __THROW. */
177 # if @REPLACE_POSIX_SPAWN@
178 # define posix_spawnp rpl_posix_spawnp
180 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
181 extern int posix_spawnp (pid_t *__pid, const char *__file,
182 const posix_spawn_file_actions_t *__file_actions,
183 const posix_spawnattr_t *__attrp,
184 char *const argv[], char *const envp[])
185 _GL_ARG_NONNULL ((2, 5, 6));
187 #elif defined GNULIB_POSIXCHECK
189 # define posix_spawnp(a,b,c,d,e,f) \
190 (GL_LINK_WARNING ("posix_spawnp is unportable - " \
191 "use gnulib module posix_spawnp for portability"), \
192 posix_spawnp (a, b, c, d, e, f))
196 #if @GNULIB_POSIX_SPAWNATTR_INIT@
197 /* Initialize data structure with attributes for `spawn' to default values. */
198 # if @REPLACE_POSIX_SPAWN@
199 # define posix_spawnattr_init rpl_posix_spawnattr_init
201 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
202 extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
203 __THROW _GL_ARG_NONNULL ((1));
205 #elif defined GNULIB_POSIXCHECK
206 # undef posix_spawnattr_init
207 # define posix_spawnattr_init(a) \
208 (GL_LINK_WARNING ("posix_spawnattr_init is unportable - " \
209 "use gnulib module posix_spawnattr_init for portability"), \
210 posix_spawnattr_init (a))
213 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
214 /* Free resources associated with ATTR. */
215 # if @REPLACE_POSIX_SPAWN@
216 # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
218 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
219 extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
220 __THROW _GL_ARG_NONNULL ((1));
222 #elif defined GNULIB_POSIXCHECK
223 # undef posix_spawnattr_destroy
224 # define posix_spawnattr_destroy(a) \
225 (GL_LINK_WARNING ("posix_spawnattr_destroy is unportable - " \
226 "use gnulib module posix_spawnattr_destroy for portability"), \
227 posix_spawnattr_destroy (a))
230 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
231 /* Store signal mask for signals with default handling from ATTR in
233 # if @REPLACE_POSIX_SPAWN@
234 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
236 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
237 extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
238 sigset_t *_Restrict_ __sigdefault)
239 __THROW _GL_ARG_NONNULL ((1, 2));
241 #elif defined GNULIB_POSIXCHECK
242 # undef posix_spawnattr_getsigdefault
243 # define posix_spawnattr_getsigdefault(a, b) \
244 (GL_LINK_WARNING ("posix_spawnattr_getsigdefault is unportable - " \
245 "use gnulib module posix_spawnattr_getsigdefault for portability"), \
246 posix_spawnattr_getsigdefault (a, b))
249 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
250 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
251 # if @REPLACE_POSIX_SPAWN@
252 # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
254 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
255 extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
256 const sigset_t *_Restrict_ __sigdefault)
257 __THROW _GL_ARG_NONNULL ((1, 2));
259 #elif defined GNULIB_POSIXCHECK
260 # undef posix_spawnattr_setsigdefault
261 # define posix_spawnattr_setsigdefault(a, b) \
262 (GL_LINK_WARNING ("posix_spawnattr_setsigdefault is unportable - " \
263 "use gnulib module posix_spawnattr_setsigdefault for portability"), \
264 posix_spawnattr_setsigdefault (a, b))
267 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
268 /* Store signal mask for the new process from ATTR in SIGMASK. */
269 # if @REPLACE_POSIX_SPAWN@
270 # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
272 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
273 extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
274 sigset_t *_Restrict_ __sigmask)
275 __THROW _GL_ARG_NONNULL ((1, 2));
277 #elif defined GNULIB_POSIXCHECK
278 # undef posix_spawnattr_getsigmask
279 # define posix_spawnattr_getsigmask(a, b) \
280 (GL_LINK_WARNING ("posix_spawnattr_getsigmask is unportable - " \
281 "use gnulib module posix_spawnattr_getsigmask for portability"), \
282 posix_spawnattr_getsigmask (a, b))
285 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
286 /* Set signal mask for the new process in ATTR to SIGMASK. */
287 # if @REPLACE_POSIX_SPAWN@
288 # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
290 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
291 extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
292 const sigset_t *_Restrict_ __sigmask)
293 __THROW _GL_ARG_NONNULL ((1, 2));
295 #elif defined GNULIB_POSIXCHECK
296 # undef posix_spawnattr_setsigmask
297 # define posix_spawnattr_setsigmask(a, b) \
298 (GL_LINK_WARNING ("posix_spawnattr_setsigmask is unportable - " \
299 "use gnulib module posix_spawnattr_setsigmask for portability"), \
300 posix_spawnattr_setsigmask (a, b))
303 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
304 /* Get flag word from the attribute structure. */
305 # if @REPLACE_POSIX_SPAWN@
306 # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
308 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
309 extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
310 short int *_Restrict_ __flags)
311 __THROW _GL_ARG_NONNULL ((1, 2));
313 #elif defined GNULIB_POSIXCHECK
314 # undef posix_spawnattr_getflags
315 # define posix_spawnattr_getflags(a, b) \
316 (GL_LINK_WARNING ("posix_spawnattr_getflags is unportable - " \
317 "use gnulib module posix_spawnattr_getflags for portability"), \
318 posix_spawnattr_getflags (a, b))
321 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
322 /* Store flags in the attribute structure. */
323 # if @REPLACE_POSIX_SPAWN@
324 # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
326 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
327 extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
329 __THROW _GL_ARG_NONNULL ((1));
331 #elif defined GNULIB_POSIXCHECK
332 # undef posix_spawnattr_setflags
333 # define posix_spawnattr_setflags(a, b) \
334 (GL_LINK_WARNING ("posix_spawnattr_setflags is unportable - " \
335 "use gnulib module posix_spawnattr_setflags for portability"), \
336 posix_spawnattr_setflags (a, b))
339 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
340 /* Get process group ID from the attribute structure. */
341 # if @REPLACE_POSIX_SPAWN@
342 # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
344 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
345 extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
346 pid_t *_Restrict_ __pgroup)
347 __THROW _GL_ARG_NONNULL ((1, 2));
349 #elif defined GNULIB_POSIXCHECK
350 # undef posix_spawnattr_getpgroup
351 # define posix_spawnattr_getpgroup(a, b) \
352 (GL_LINK_WARNING ("posix_spawnattr_getpgroup is unportable - " \
353 "use gnulib module posix_spawnattr_getpgroup for portability"), \
354 posix_spawnattr_getpgroup (a, b))
357 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
358 /* Store process group ID in the attribute structure. */
359 # if @REPLACE_POSIX_SPAWN@
360 # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
362 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
363 extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
365 __THROW _GL_ARG_NONNULL ((1));
367 #elif defined GNULIB_POSIXCHECK
368 # undef posix_spawnattr_setpgroup
369 # define posix_spawnattr_setpgroup(a, b) \
370 (GL_LINK_WARNING ("posix_spawnattr_setpgroup is unportable - " \
371 "use gnulib module posix_spawnattr_setpgroup for portability"), \
372 posix_spawnattr_setpgroup (a, b))
375 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
376 /* Get scheduling policy from the attribute structure. */
377 # if @REPLACE_POSIX_SPAWN@
378 # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
380 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
381 extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
382 int *_Restrict_ __schedpolicy)
383 __THROW _GL_ARG_NONNULL ((1, 2));
385 #elif defined GNULIB_POSIXCHECK
386 # undef posix_spawnattr_getschedpolicy
387 # define posix_spawnattr_getschedpolicy(a, b) \
388 (GL_LINK_WARNING ("posix_spawnattr_getschedpolicy is unportable - " \
389 "use gnulib module posix_spawnattr_getschedpolicy for portability"), \
390 posix_spawnattr_getschedpolicy (a, b))
393 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
394 /* Store scheduling policy in the attribute structure. */
395 # if @REPLACE_POSIX_SPAWN@
396 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
398 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
399 extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
401 __THROW _GL_ARG_NONNULL ((1));
403 #elif defined GNULIB_POSIXCHECK
404 # undef posix_spawnattr_setschedpolicy
405 # define posix_spawnattr_setschedpolicy(a, b) \
406 (GL_LINK_WARNING ("posix_spawnattr_setschedpolicy is unportable - " \
407 "use gnulib module posix_spawnattr_setschedpolicy for portability"), \
408 posix_spawnattr_setschedpolicy (a, b))
411 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
412 /* Get scheduling parameters from the attribute structure. */
413 # if @REPLACE_POSIX_SPAWN@
414 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
416 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
417 extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
418 struct sched_param *_Restrict_ __schedparam)
419 __THROW _GL_ARG_NONNULL ((1, 2));
421 #elif defined GNULIB_POSIXCHECK
422 # undef posix_spawnattr_getschedparam
423 # define posix_spawnattr_getschedparam(a, b) \
424 (GL_LINK_WARNING ("posix_spawnattr_getschedparam is unportable - " \
425 "use gnulib module posix_spawnattr_getschedparam for portability"), \
426 posix_spawnattr_getschedparam (a, b))
429 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
430 /* Store scheduling parameters in the attribute structure. */
431 # if @REPLACE_POSIX_SPAWN@
432 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
434 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
435 extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
436 const struct sched_param *_Restrict_ __schedparam)
437 __THROW _GL_ARG_NONNULL ((1, 2));
439 #elif defined GNULIB_POSIXCHECK
440 # undef posix_spawnattr_setschedparam
441 # define posix_spawnattr_setschedparam(a, b) \
442 (GL_LINK_WARNING ("posix_spawnattr_setschedparam is unportable - " \
443 "use gnulib module posix_spawnattr_setschedparam for portability"), \
444 posix_spawnattr_setschedparam (a, b))
448 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
449 /* Initialize data structure for file attribute for `spawn' call. */
450 # if @REPLACE_POSIX_SPAWN@
451 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
453 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
454 extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
455 __THROW _GL_ARG_NONNULL ((1));
457 #elif defined GNULIB_POSIXCHECK
458 # undef posix_spawn_file_actions_init
459 # define posix_spawn_file_actions_init(a) \
460 (GL_LINK_WARNING ("posix_spawn_file_actions_init is unportable - " \
461 "use gnulib module posix_spawn_file_actions_init for portability"), \
462 posix_spawn_file_actions_init (a))
465 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
466 /* Free resources associated with FILE-ACTIONS. */
467 # if @REPLACE_POSIX_SPAWN@
468 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
470 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
471 extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
472 __THROW _GL_ARG_NONNULL ((1));
474 #elif defined GNULIB_POSIXCHECK
475 # undef posix_spawn_file_actions_destroy
476 # define posix_spawn_file_actions_destroy(a) \
477 (GL_LINK_WARNING ("posix_spawn_file_actions_destroy is unportable - " \
478 "use gnulib module posix_spawn_file_actions_destroy for portability"), \
479 posix_spawn_file_actions_destroy (a))
482 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
483 /* Add an action to FILE-ACTIONS which tells the implementation to call
484 `open' for the given file during the `spawn' call. */
485 # if @REPLACE_POSIX_SPAWN@
486 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
488 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
489 extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions,
491 const char *_Restrict_ __path,
492 int __oflag, mode_t __mode)
493 __THROW _GL_ARG_NONNULL ((1, 3));
495 #elif defined GNULIB_POSIXCHECK
496 # undef posix_spawn_file_actions_addopen
497 # define posix_spawn_file_actions_addopen(a, b, c, d, e) \
498 (GL_LINK_WARNING ("posix_spawn_file_actions_addopen is unportable - " \
499 "use gnulib module posix_spawn_file_actions_addopen for portability"), \
500 posix_spawn_file_actions_addopen (a, b, c, d, e))
503 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
504 /* Add an action to FILE-ACTIONS which tells the implementation to call
505 `close' for the given file descriptor during the `spawn' call. */
506 # if @REPLACE_POSIX_SPAWN@
507 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
509 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
510 extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
512 __THROW _GL_ARG_NONNULL ((1));
514 #elif defined GNULIB_POSIXCHECK
515 # undef posix_spawn_file_actions_addclose
516 # define posix_spawn_file_actions_addclose(a,b) \
517 (GL_LINK_WARNING ("posix_spawn_file_actions_addclose is unportable - " \
518 "use gnulib module posix_spawn_file_actions_addclose for portability"), \
519 posix_spawn_file_actions_addclose (a, b))
522 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
523 /* Add an action to FILE-ACTIONS which tells the implementation to call
524 `dup2' for the given file descriptors during the `spawn' call. */
525 # if @REPLACE_POSIX_SPAWN@
526 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
528 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
529 extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
530 int __fd, int __newfd)
531 __THROW _GL_ARG_NONNULL ((1));
533 #elif defined GNULIB_POSIXCHECK
534 # undef posix_spawn_file_actions_adddup2
535 # define posix_spawn_file_actions_adddup2(a,b,c) \
536 (GL_LINK_WARNING ("posix_spawn_file_actions_adddup2 is unportable - " \
537 "use gnulib module posix_spawn_file_actions_adddup2 for portability"), \
538 posix_spawn_file_actions_adddup2 (a, b, c))
547 #endif /* _GL_SPAWN_H */
548 #endif /* _GL_SPAWN_H */