spawn: Fix misapplied patch.
[gnulib.git] / lib / spawn.in.h
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.
4
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.
9
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.
14
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/>.  */
17
18 #ifndef _GL_SPAWN_H
19
20 #if __GNUC__ >= 3
21 @PRAGMA_SYSTEM_HEADER@
22 #endif
23
24 /* The include_next requires a split double-inclusion guard.  */
25 #if @HAVE_SPAWN_H@
26 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
27 #endif
28
29 #ifndef _GL_SPAWN_H
30 #define _GL_SPAWN_H
31
32 #include <sched.h>
33 #include <signal.h>
34 #include <sys/types.h>
35
36 #ifndef __THROW
37 # define __THROW
38 #endif
39
40 /* GCC 2.95 and later have "__restrict"; C99 compilers have
41    "restrict", and "configure" may have defined "restrict".
42    Other compilers use __restrict, __restrict__, and _Restrict, and
43    'configure' might #define 'restrict' to those words, so pick a
44    different name.  */
45 #ifndef _Restrict_
46 # if 199901L <= __STDC_VERSION__
47 #  define _Restrict_ restrict
48 # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
49 #  define _Restrict_ __restrict
50 # else
51 #  define _Restrict_
52 # endif
53 #endif
54 /* gcc 3.1 and up support the [restrict] syntax.  Don't trust
55    sys/cdefs.h's definition of __restrict_arr, though, as it
56    mishandles gcc -ansi -pedantic.  */
57 #ifndef _Restrict_arr_
58 # if ((199901L <= __STDC_VERSION__                                      \
59        || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))     \
60            && !__STRICT_ANSI__))                                        \
61       && !defined __GNUG__)
62 #  define _Restrict_arr_ _Restrict_
63 # else
64 #  define _Restrict_arr_
65 # endif
66 #endif
67
68 /* The definition of GL_LINK_WARNING is copied here.  */
69
70 /* The definition of _GL_ARG_NONNULL is copied here.  */
71
72
73 /* Data structure to contain attributes for thread creation.  */
74 #if @REPLACE_POSIX_SPAWN@
75 # define posix_spawnattr_t rpl_posix_spawnattr_t
76 #endif
77 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
78 typedef struct
79 {
80   short int _flags;
81   pid_t _pgrp;
82   sigset_t _sd;
83   sigset_t _ss;
84   struct sched_param _sp;
85   int _policy;
86   int __pad[16];
87 } posix_spawnattr_t;
88 #endif
89
90
91 /* Data structure to contain information about the actions to be
92    performed in the new process with respect to file descriptors.  */
93 #if @REPLACE_POSIX_SPAWN@
94 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
95 #endif
96 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
97 typedef struct
98 {
99   int _allocated;
100   int _used;
101   struct __spawn_action *_actions;
102   int __pad[16];
103 } posix_spawn_file_actions_t;
104 #endif
105
106
107 /* Flags to be set in the `posix_spawnattr_t'.  */
108 #if @REPLACE_POSIX_SPAWN@
109 /* Use the values from the system, for better compatibility.  */
110 /* But this implementation does not support AIX extensions.  */
111 # undef POSIX_SPAWN_FORK_HANDLERS
112 #else
113 # define POSIX_SPAWN_RESETIDS           0x01
114 # define POSIX_SPAWN_SETPGROUP          0x02
115 # define POSIX_SPAWN_SETSIGDEF          0x04
116 # define POSIX_SPAWN_SETSIGMASK         0x08
117 # define POSIX_SPAWN_SETSCHEDPARAM      0x10
118 # define POSIX_SPAWN_SETSCHEDULER       0x20
119 #endif
120 /* A GNU extension.  Use the next free bit position.  */
121 #define POSIX_SPAWN_USEVFORK \
122   ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1)                   \
123     | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1)               \
124     | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1)               \
125     | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1)             \
126     | POSIX_SPAWN_SETSCHEDPARAM | (POSIX_SPAWN_SETSCHEDPARAM - 1)       \
127     | POSIX_SPAWN_SETSCHEDULER | (POSIX_SPAWN_SETSCHEDULER - 1))        \
128    + 1)
129 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
130             [2 * (((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
131                     | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
132                     | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
133                    & POSIX_SPAWN_USEVFORK) == 0) - 1];
134
135
136 #ifdef __cplusplus
137 extern "C" {
138 #endif
139
140
141 #if @GNULIB_POSIX_SPAWN@
142 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
143    Before running the process perform the actions described in FILE-ACTIONS.
144
145    This function is a possible cancellation points and therefore not
146    marked with __THROW. */
147 # if @REPLACE_POSIX_SPAWN@
148 #  define posix_spawn rpl_posix_spawn
149 # endif
150 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
151 extern int posix_spawn (pid_t *_Restrict_ __pid,
152                         const char *_Restrict_ __path,
153                         const posix_spawn_file_actions_t *_Restrict_ __file_actions,
154                         const posix_spawnattr_t *_Restrict_ __attrp,
155                         char *const argv[_Restrict_arr_],
156                         char *const envp[_Restrict_arr_])
157      _GL_ARG_NONNULL ((2, 5, 6));
158 # endif
159 #elif defined GNULIB_POSIXCHECK
160 # undef posix_spawn
161 # define posix_spawn(a,b,c,d,e,f)                   \
162   (GL_LINK_WARNING ("posix_spawn is unportable - "        \
163                     "use gnulib module posix_spawn for portability"),   \
164    posix_spawn (a, b, c, d, e, f))
165 #endif
166
167 #if @GNULIB_POSIX_SPAWNP@
168 /* Similar to `posix_spawn' but search for FILE in the PATH.
169
170    This function is a possible cancellation points and therefore not
171    marked with __THROW.  */
172 # if @REPLACE_POSIX_SPAWN@
173 #  define posix_spawnp rpl_posix_spawnp
174 # endif
175 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
176 extern int posix_spawnp (pid_t *__pid, const char *__file,
177                          const posix_spawn_file_actions_t *__file_actions,
178                          const posix_spawnattr_t *__attrp,
179                          char *const argv[], char *const envp[])
180      _GL_ARG_NONNULL ((2, 5, 6));
181 # endif
182 #elif defined GNULIB_POSIXCHECK
183 # undef posix_spawnp
184 # define posix_spawnp(a,b,c,d,e,f)                   \
185   (GL_LINK_WARNING ("posix_spawnp is unportable - "        \
186                     "use gnulib module posix_spawnp for portability"),   \
187    posix_spawnp (a, b, c, d, e, f))
188 #endif
189
190
191 #if @GNULIB_POSIX_SPAWNATTR_INIT@
192 /* Initialize data structure with attributes for `spawn' to default values.  */
193 # if @REPLACE_POSIX_SPAWN@
194 #  define posix_spawnattr_init rpl_posix_spawnattr_init
195 # endif
196 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
197 extern int posix_spawnattr_init (posix_spawnattr_t *__attr)
198      __THROW _GL_ARG_NONNULL ((1));
199 # endif
200 #elif defined GNULIB_POSIXCHECK
201 # undef posix_spawnattr_init
202 # define posix_spawnattr_init(a)                   \
203   (GL_LINK_WARNING ("posix_spawnattr_init is unportable - "        \
204                     "use gnulib module posix_spawnattr_init for portability"), \
205    posix_spawnattr_init (a))
206 #endif
207
208 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
209 /* Free resources associated with ATTR.  */
210 # if @REPLACE_POSIX_SPAWN@
211 #  define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
212 # endif
213 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
214 extern int posix_spawnattr_destroy (posix_spawnattr_t *__attr)
215      __THROW _GL_ARG_NONNULL ((1));
216 # endif
217 #elif defined GNULIB_POSIXCHECK
218 # undef posix_spawnattr_destroy
219 # define posix_spawnattr_destroy(a)                   \
220   (GL_LINK_WARNING ("posix_spawnattr_destroy is unportable - "        \
221                     "use gnulib module posix_spawnattr_destroy for portability"), \
222    posix_spawnattr_destroy (a))
223 #endif
224
225 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
226 /* Store signal mask for signals with default handling from ATTR in
227    SIGDEFAULT.  */
228 # if @REPLACE_POSIX_SPAWN@
229 #  define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
230 # endif
231 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
232 extern int posix_spawnattr_getsigdefault (const posix_spawnattr_t *_Restrict_ __attr,
233                                           sigset_t *_Restrict_ __sigdefault)
234      __THROW _GL_ARG_NONNULL ((1, 2));
235 # endif
236 #elif defined GNULIB_POSIXCHECK
237 # undef posix_spawnattr_getsigdefault
238 # define posix_spawnattr_getsigdefault(a, b)                         \
239   (GL_LINK_WARNING ("posix_spawnattr_getsigdefault is unportable - "        \
240                     "use gnulib module posix_spawnattr_getsigdefault for portability"), \
241    posix_spawnattr_getsigdefault (a, b))
242 #endif
243
244 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
245 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT.  */
246 # if @REPLACE_POSIX_SPAWN@
247 #  define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
248 # endif
249 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
250 extern int posix_spawnattr_setsigdefault (posix_spawnattr_t *_Restrict_ __attr,
251                                           const sigset_t *_Restrict_ __sigdefault)
252      __THROW _GL_ARG_NONNULL ((1, 2));
253 # endif
254 #elif defined GNULIB_POSIXCHECK
255 # undef posix_spawnattr_setsigdefault
256 # define posix_spawnattr_setsigdefault(a, b)                         \
257   (GL_LINK_WARNING ("posix_spawnattr_setsigdefault is unportable - "        \
258                     "use gnulib module posix_spawnattr_setsigdefault for portability"), \
259    posix_spawnattr_setsigdefault (a, b))
260 #endif
261
262 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
263 /* Store signal mask for the new process from ATTR in SIGMASK.  */
264 # if @REPLACE_POSIX_SPAWN@
265 #  define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
266 # endif
267 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
268 extern int posix_spawnattr_getsigmask (const posix_spawnattr_t *_Restrict_ __attr,
269                                        sigset_t *_Restrict_ __sigmask)
270      __THROW _GL_ARG_NONNULL ((1, 2));
271 # endif
272 #elif defined GNULIB_POSIXCHECK
273 # undef posix_spawnattr_getsigmask
274 # define posix_spawnattr_getsigmask(a, b)                         \
275   (GL_LINK_WARNING ("posix_spawnattr_getsigmask is unportable - "        \
276                     "use gnulib module posix_spawnattr_getsigmask for portability"), \
277    posix_spawnattr_getsigmask (a, b))
278 #endif
279
280 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
281 /* Set signal mask for the new process in ATTR to SIGMASK.  */
282 # if @REPLACE_POSIX_SPAWN@
283 #  define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
284 # endif
285 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
286 extern int posix_spawnattr_setsigmask (posix_spawnattr_t *_Restrict_ __attr,
287                                        const sigset_t *_Restrict_ __sigmask)
288      __THROW _GL_ARG_NONNULL ((1, 2));
289 # endif
290 #elif defined GNULIB_POSIXCHECK
291 # undef posix_spawnattr_setsigmask
292 # define posix_spawnattr_setsigmask(a, b)                         \
293   (GL_LINK_WARNING ("posix_spawnattr_setsigmask is unportable - "        \
294                     "use gnulib module posix_spawnattr_setsigmask for portability"), \
295    posix_spawnattr_setsigmask (a, b))
296 #endif
297
298 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
299 /* Get flag word from the attribute structure.  */
300 # if @REPLACE_POSIX_SPAWN@
301 #  define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
302 # endif
303 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
304 extern int posix_spawnattr_getflags (const posix_spawnattr_t *_Restrict_ __attr,
305                                      short int *_Restrict_ __flags)
306      __THROW _GL_ARG_NONNULL ((1, 2));
307 # endif
308 #elif defined GNULIB_POSIXCHECK
309 # undef posix_spawnattr_getflags
310 # define posix_spawnattr_getflags(a, b)                         \
311   (GL_LINK_WARNING ("posix_spawnattr_getflags is unportable - "        \
312                     "use gnulib module posix_spawnattr_getflags for portability"), \
313    posix_spawnattr_getsigdefault (a, b))
314 #endif
315
316 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
317 /* Store flags in the attribute structure.  */
318 # if @REPLACE_POSIX_SPAWN@
319 #  define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
320 # endif
321 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
322 extern int posix_spawnattr_setflags (posix_spawnattr_t *__attr,
323                                      short int __flags)
324      __THROW _GL_ARG_NONNULL ((1));
325 # endif
326 #elif defined GNULIB_POSIXCHECK
327 # undef posix_spawnattr_setflags
328 # define posix_spawnattr_setflags(a, b)                         \
329   (GL_LINK_WARNING ("posix_spawnattr_setflags is unportable - "        \
330                     "use gnulib module posix_spawnattr_setflags for portability"), \
331    posix_spawnattr_getflags (a, b))
332 #endif
333
334 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
335 /* Get process group ID from the attribute structure.  */
336 # if @REPLACE_POSIX_SPAWN@
337 #  define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
338 # endif
339 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
340 extern int posix_spawnattr_getpgroup (const posix_spawnattr_t *_Restrict_ __attr,
341                                       pid_t *_Restrict_ __pgroup)
342      __THROW _GL_ARG_NONNULL ((1, 2));
343 # endif
344 #elif defined GNULIB_POSIXCHECK
345 # undef posix_spawnattr_getpgroup
346 # define posix_spawnattr_getpgroup(a, b)                         \
347   (GL_LINK_WARNING ("posix_spawnattr_getpgroup is unportable - "        \
348                     "use gnulib module posix_spawnattr_getpgroup for portability"), \
349    posix_spawnattr_setflags (a, b))
350 #endif
351
352 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
353 /* Store process group ID in the attribute structure.  */
354 # if @REPLACE_POSIX_SPAWN@
355 #  define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
356 # endif
357 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
358 extern int posix_spawnattr_setpgroup (posix_spawnattr_t *__attr,
359                                       pid_t __pgroup)
360      __THROW _GL_ARG_NONNULL ((1));
361 # endif
362 #elif defined GNULIB_POSIXCHECK
363 # undef posix_spawnattr_setpgroup
364 # define posix_spawnattr_setpgroup(a, b)                         \
365   (GL_LINK_WARNING ("posix_spawnattr_setpgroup is unportable - "        \
366                     "use gnulib module posix_spawnattr_setpgroup for portability"), \
367    posix_spawnattr_setflags (a, b))
368 #endif
369
370 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
371 /* Get scheduling policy from the attribute structure.  */
372 # if @REPLACE_POSIX_SPAWN@
373 #  define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
374 # endif
375 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
376 extern int posix_spawnattr_getschedpolicy (const posix_spawnattr_t *_Restrict_ __attr,
377                                            int *_Restrict_ __schedpolicy)
378      __THROW _GL_ARG_NONNULL ((1, 2));
379 # endif
380 #elif defined GNULIB_POSIXCHECK
381 # undef posix_spawnattr_getschedpolicy
382 # define posix_spawnattr_getschedpolicy(a, b)                         \
383   (GL_LINK_WARNING ("posix_spawnattr_getschedpolicy is unportable - "        \
384                     "use gnulib module posix_spawnattr_getschedpolicy for portability"), \
385    posix_spawnattr_getschedpolicy (a, b))
386 #endif
387
388 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
389 /* Store scheduling policy in the attribute structure.  */
390 # if @REPLACE_POSIX_SPAWN@
391 #  define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
392 # endif
393 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
394 extern int posix_spawnattr_setschedpolicy (posix_spawnattr_t *__attr,
395                                            int __schedpolicy)
396      __THROW _GL_ARG_NONNULL ((1));
397 # endif
398 #elif defined GNULIB_POSIXCHECK
399 # undef posix_spawnattr_setschedpolicy
400 # define posix_spawnattr_setschedpolicy(a, b)                         \
401   (GL_LINK_WARNING ("posix_spawnattr_setschedpolicy is unportable - "        \
402                     "use gnulib module posix_spawnattr_setschedpolicy for portability"), \
403    posix_spawnattr_setschedpolicy (a, b))
404 #endif
405
406 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
407 /* Get scheduling parameters from the attribute structure.  */
408 # if @REPLACE_POSIX_SPAWN@
409 #  define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
410 # endif
411 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
412 extern int posix_spawnattr_getschedparam (const posix_spawnattr_t *_Restrict_ __attr,
413                                           struct sched_param *_Restrict_ __schedparam)
414      __THROW _GL_ARG_NONNULL ((1, 2));
415 # endif
416 #elif defined GNULIB_POSIXCHECK
417 # undef posix_spawnattr_getschedparam
418 # define posix_spawnattr_getschedparam(a, b)                         \
419   (GL_LINK_WARNING ("posix_spawnattr_getschedparam is unportable - "        \
420                     "use gnulib module posix_spawnattr_getschedparam for portability"), \
421    posix_spawnattr_getschedparam (a, b))
422 #endif
423
424 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
425 /* Store scheduling parameters in the attribute structure.  */
426 # if @REPLACE_POSIX_SPAWN@
427 #  define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
428 # endif
429 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
430 extern int posix_spawnattr_setschedparam (posix_spawnattr_t *_Restrict_ __attr,
431                                           const struct sched_param *_Restrict_ __schedparam)
432      __THROW _GL_ARG_NONNULL ((1, 2));
433 # endif
434 #elif defined GNULIB_POSIXCHECK
435 # undef posix_spawnattr_setschedparam
436 # define posix_spawnattr_setschedparam(a, b)                         \
437   (GL_LINK_WARNING ("posix_spawnattr_setschedparam is unportable - "        \
438                     "use gnulib module posix_spawnattr_setschedparam for portability"), \
439    posix_spawnattr_setschedparam (a, b))
440 #endif
441
442
443 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
444 /* Initialize data structure for file attribute for `spawn' call.  */
445 # if @REPLACE_POSIX_SPAWN@
446 #  define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
447 # endif
448 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
449 extern int posix_spawn_file_actions_init (posix_spawn_file_actions_t *__file_actions)
450      __THROW _GL_ARG_NONNULL ((1));
451 # endif
452 #elif defined GNULIB_POSIXCHECK
453 # undef posix_spawn_file_actions_init
454 # define posix_spawn_file_actions_init(a)                         \
455   (GL_LINK_WARNING ("posix_spawn_file_actions_init is unportable - "        \
456                     "use gnulib module posix_spawn_file_actions_init for portability"), \
457    posix_spawn_file_actions_init (a))
458 #endif
459
460 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
461 /* Free resources associated with FILE-ACTIONS.  */
462 # if @REPLACE_POSIX_SPAWN@
463 #  define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
464 # endif
465 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
466 extern int posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *__file_actions)
467      __THROW _GL_ARG_NONNULL ((1));
468 # endif
469 #elif defined GNULIB_POSIXCHECK
470 # undef posix_spawn_file_actions_destroy
471 # define posix_spawn_file_actions_destroy(a)                         \
472   (GL_LINK_WARNING ("posix_spawn_file_actions_destroy is unportable - "        \
473                     "use gnulib module posix_spawn_file_actions_destroy for portability"), \
474    posix_spawn_file_actions_destroy (a))
475 #endif
476
477 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
478 /* Add an action to FILE-ACTIONS which tells the implementation to call
479    `open' for the given file during the `spawn' call.  */
480 # if @REPLACE_POSIX_SPAWN@
481 #  define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
482 # endif
483 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
484 extern int posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *_Restrict_ __file_actions,
485                                              int __fd,
486                                              const char *_Restrict_ __path,
487                                              int __oflag, mode_t __mode)
488      __THROW _GL_ARG_NONNULL ((1, 3));
489 # endif
490 #elif defined GNULIB_POSIXCHECK
491 # undef posix_spawn_file_actions_addopen
492 # define posix_spawn_file_actions_addopen(a, b, c, d, e)                     \
493   (GL_LINK_WARNING ("posix_spawn_file_actions_addopen is unportable - "        \
494                     "use gnulib module posix_spawn_file_actions_addopen for portability"), \
495    posix_spawn_file_actions_addopen (a, b, c, d, e))
496 #endif
497
498 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
499 /* Add an action to FILE-ACTIONS which tells the implementation to call
500    `close' for the given file descriptor during the `spawn' call.  */
501 # if @REPLACE_POSIX_SPAWN@
502 #  define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
503 # endif
504 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
505 extern int posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *__file_actions,
506                                               int __fd)
507      __THROW _GL_ARG_NONNULL ((1));
508 # endif
509 #elif defined GNULIB_POSIXCHECK
510 # undef posix_spawn_file_actions_addclose
511 # define posix_spawn_file_actions_addclose(a,b)                          \
512   (GL_LINK_WARNING ("posix_spawn_file_actions_addclose is unportable - "        \
513                     "use gnulib module posix_spawn_file_actions_addclose for portability"), \
514    posix_spawn_file_actions_addclose (a, b))
515 #endif
516
517 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
518 /* Add an action to FILE-ACTIONS which tells the implementation to call
519    `dup2' for the given file descriptors during the `spawn' call.  */
520 # if @REPLACE_POSIX_SPAWN@
521 #  define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
522 # endif
523 # if !@HAVE_POSIX_SPAWN@ || @REPLACE_POSIX_SPAWN@
524 extern int posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *__file_actions,
525                                              int __fd, int __newfd)
526      __THROW _GL_ARG_NONNULL ((1));
527 # endif
528 #elif defined GNULIB_POSIXCHECK
529 # undef posix_spawn_file_actions_adddup2
530 # define posix_spawn_file_actions_adddup2(a,b,c)                         \
531   (GL_LINK_WARNING ("posix_spawn_file_actions_adddup2 is unportable - "        \
532                     "use gnulib module posix_spawn_file_actions_adddup2 for portability"), \
533    posix_spawn_file_actions_adddup2 (a, b, c))
534 #endif
535
536
537 #ifdef __cplusplus
538 }
539 #endif
540
541
542 #endif /* _GL_SPAWN_H */
543 #endif /* _GL_SPAWN_H */