exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / spawn.in.h
blob2a4576ff08c08c1251ad594e74bc17a82c33af90
1 /* Definitions for POSIX spawn interface.
2 Copyright (C) 2000, 2003-2004, 2008-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 This file 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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
18 #if __GNUC__ >= 3
19 @PRAGMA_SYSTEM_HEADER@
20 #endif
21 @PRAGMA_COLUMNS@
23 #if defined _GL_ALREADY_INCLUDING_SPAWN_H
24 /* Special invocation convention:
25 On OS/2 kLIBC, <spawn.h> includes <signal.h>. Then <signal.h> ->
26 <pthread.h> -> <sched.h> -> <spawn.h> are included by GNULIB.
27 In this situation, struct sched_param is not yet defined. */
29 #@INCLUDE_NEXT@ @NEXT_SPAWN_H@
31 #else
33 #ifndef _@GUARD_PREFIX@_SPAWN_H
34 /* Normal invocation convention. */
36 /* The include_next requires a split double-inclusion guard. */
37 #if @HAVE_SPAWN_H@
39 # define _GL_ALREADY_INCLUDING_SPAWN_H
41 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
43 # define _GL_ALREADY_INCLUDING_SPAWN_H
45 #endif
47 #ifndef _@GUARD_PREFIX@_SPAWN_H
48 #define _@GUARD_PREFIX@_SPAWN_H
50 /* This file uses GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
51 #if !_GL_CONFIG_H_INCLUDED
52 #error "Please include config.h first."
53 #endif
55 /* Get definitions of 'struct sched_param' and 'sigset_t'.
56 But avoid namespace pollution on glibc systems. */
57 #if !(defined __GLIBC__ && !defined __UCLIBC__)
58 # include <sched.h>
59 # include <signal.h>
60 #endif
62 #include <sys/types.h>
64 #ifndef __THROW
65 # define __THROW
66 #endif
68 /* For plain 'restrict', use glibc's __restrict if defined.
69 Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
70 "restrict", and "configure" may have defined "restrict".
71 Other compilers use __restrict, __restrict__, and _Restrict, and
72 'configure' might #define 'restrict' to those words, so pick a
73 different name. */
74 #ifndef _Restrict_
75 # if defined __restrict \
76 || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
77 || __clang_major__ >= 3
78 # define _Restrict_ __restrict
79 # elif 199901L <= __STDC_VERSION__ || defined restrict
80 # define _Restrict_ restrict
81 # else
82 # define _Restrict_
83 # endif
84 #endif
85 /* For the ISO C99 syntax
86 array_name[restrict]
87 use glibc's __restrict_arr if available.
88 Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
89 Other ISO C99 compilers support it as well. */
90 #ifndef _Restrict_arr_
91 # ifdef __restrict_arr
92 # define _Restrict_arr_ __restrict_arr
93 # elif ((199901L <= __STDC_VERSION__ \
94 || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
95 || __clang_major__ >= 3) \
96 && !defined __cplusplus)
97 # define _Restrict_arr_ _Restrict_
98 # else
99 # define _Restrict_arr_
100 # endif
101 #endif
103 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
105 /* The definition of _GL_ARG_NONNULL is copied here. */
107 /* The definition of _GL_WARN_ON_USE is copied here. */
110 /* Data structure to contain attributes for thread creation. */
111 #if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWNATTR_T@ && !@HAVE_POSIX_SPAWN@)
112 # define posix_spawnattr_t rpl_posix_spawnattr_t
113 #endif
114 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@ || !@HAVE_POSIX_SPAWN@
115 # if !GNULIB_defined_posix_spawnattr_t
116 typedef struct
118 short int _flags;
119 pid_t _pgrp;
120 sigset_t _sd;
121 sigset_t _ss;
122 struct sched_param _sp;
123 int _policy;
124 int __pad[16];
125 } posix_spawnattr_t;
126 # define GNULIB_defined_posix_spawnattr_t 1
127 # endif
128 #endif
131 /* Data structure to contain information about the actions to be
132 performed in the new process with respect to file descriptors. */
133 #if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ && !@HAVE_POSIX_SPAWN@)
134 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
135 #endif
136 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ || !@HAVE_POSIX_SPAWN@
137 # if !GNULIB_defined_posix_spawn_file_actions_t
138 typedef struct
140 int _allocated;
141 int _used;
142 struct __spawn_action *_actions;
143 int __pad[16];
144 } posix_spawn_file_actions_t;
145 # define GNULIB_defined_posix_spawn_file_actions_t 1
146 # endif
147 #endif
150 /* Flags to be set in the 'posix_spawnattr_t'. */
151 #if @HAVE_POSIX_SPAWN@
152 # if @REPLACE_POSIX_SPAWN@
153 /* Use the values from the system, for better compatibility. */
154 /* But this implementation does not support AIX extensions. */
155 # undef POSIX_SPAWN_FORK_HANDLERS
156 # endif
157 /* Provide the values that the system is lacking. */
158 # ifndef POSIX_SPAWN_SETSCHEDPARAM
159 # define POSIX_SPAWN_SETSCHEDPARAM 0
160 # endif
161 # ifndef POSIX_SPAWN_SETSCHEDULER
162 # define POSIX_SPAWN_SETSCHEDULER 0
163 # endif
164 #else /* !@HAVE_POSIX_SPAWN@ */
165 # define POSIX_SPAWN_RESETIDS 0x01
166 # define POSIX_SPAWN_SETPGROUP 0x02
167 # define POSIX_SPAWN_SETSIGDEF 0x04
168 # define POSIX_SPAWN_SETSIGMASK 0x08
169 # define POSIX_SPAWN_SETSCHEDPARAM 0x10
170 # define POSIX_SPAWN_SETSCHEDULER 0x20
171 #endif
172 /* A GNU extension. Use the next free bit position. */
173 #ifndef POSIX_SPAWN_USEVFORK
174 # define POSIX_SPAWN_USEVFORK \
175 ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
176 | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
177 | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
178 | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
179 | POSIX_SPAWN_SETSCHEDPARAM \
180 | (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
181 | POSIX_SPAWN_SETSCHEDULER \
182 | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
183 + 1)
184 #endif
185 #if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
186 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
187 [(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
188 | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
189 | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
190 & POSIX_SPAWN_USEVFORK)
191 == 0)
192 ? 1 : -1];
193 # define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
194 #endif
197 #if @GNULIB_POSIX_SPAWN@
198 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
199 Before running the process perform the actions described in FILE-ACTIONS.
201 This function is a possible cancellation points and therefore not
202 marked with __THROW. */
203 # if @REPLACE_POSIX_SPAWN@
204 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
205 # define posix_spawn rpl_posix_spawn
206 # endif
207 _GL_FUNCDECL_RPL (posix_spawn, int,
208 (pid_t *_Restrict_ __pid,
209 const char *_Restrict_ __path,
210 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
211 const posix_spawnattr_t *_Restrict_ __attrp,
212 char *const argv[_Restrict_arr_],
213 char *const envp[_Restrict_arr_])
214 _GL_ARG_NONNULL ((2, 5, 6)));
215 _GL_CXXALIAS_RPL (posix_spawn, int,
216 (pid_t *_Restrict_ __pid,
217 const char *_Restrict_ __path,
218 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
219 const posix_spawnattr_t *_Restrict_ __attrp,
220 char *const argv[_Restrict_arr_],
221 char *const envp[_Restrict_arr_]));
222 # else
223 # if !@HAVE_POSIX_SPAWN@
224 _GL_FUNCDECL_SYS (posix_spawn, int,
225 (pid_t *_Restrict_ __pid,
226 const char *_Restrict_ __path,
227 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
228 const posix_spawnattr_t *_Restrict_ __attrp,
229 char *const argv[_Restrict_arr_],
230 char *const envp[_Restrict_arr_])
231 _GL_ARG_NONNULL ((2, 5, 6)));
232 # endif
233 _GL_CXXALIAS_SYS (posix_spawn, int,
234 (pid_t *_Restrict_ __pid,
235 const char *_Restrict_ __path,
236 const posix_spawn_file_actions_t *_Restrict_ __file_actions,
237 const posix_spawnattr_t *_Restrict_ __attrp,
238 char *const argv[_Restrict_arr_],
239 char *const envp[_Restrict_arr_]));
240 # endif
241 # if __GLIBC__ >= 2
242 _GL_CXXALIASWARN (posix_spawn);
243 # endif
244 #elif defined GNULIB_POSIXCHECK
245 # undef posix_spawn
246 # if HAVE_RAW_DECL_POSIX_SPAWN
247 _GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
248 "use gnulib module posix_spawn for portability");
249 # endif
250 #endif
252 #if @GNULIB_POSIX_SPAWNP@
253 /* Similar to 'posix_spawn' but search for FILE in the PATH.
255 This function is a possible cancellation points and therefore not
256 marked with __THROW. */
257 # if @REPLACE_POSIX_SPAWN@
258 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
259 # define posix_spawnp rpl_posix_spawnp
260 # endif
261 _GL_FUNCDECL_RPL (posix_spawnp, int,
262 (pid_t *__pid, const char *__file,
263 const posix_spawn_file_actions_t *__file_actions,
264 const posix_spawnattr_t *__attrp,
265 char *const argv[], char *const envp[])
266 _GL_ARG_NONNULL ((2, 5, 6)));
267 _GL_CXXALIAS_RPL (posix_spawnp, int,
268 (pid_t *__pid, const char *__file,
269 const posix_spawn_file_actions_t *__file_actions,
270 const posix_spawnattr_t *__attrp,
271 char *const argv[], char *const envp[]));
272 # else
273 # if !@HAVE_POSIX_SPAWN@
274 _GL_FUNCDECL_SYS (posix_spawnp, int,
275 (pid_t *__pid, const char *__file,
276 const posix_spawn_file_actions_t *__file_actions,
277 const posix_spawnattr_t *__attrp,
278 char *const argv[], char *const envp[])
279 _GL_ARG_NONNULL ((2, 5, 6)));
280 # endif
281 _GL_CXXALIAS_SYS (posix_spawnp, int,
282 (pid_t *__pid, const char *__file,
283 const posix_spawn_file_actions_t *__file_actions,
284 const posix_spawnattr_t *__attrp,
285 char *const argv[], char *const envp[]));
286 # endif
287 # if __GLIBC__ >= 2
288 _GL_CXXALIASWARN (posix_spawnp);
289 # endif
290 #elif defined GNULIB_POSIXCHECK
291 # undef posix_spawnp
292 # if HAVE_RAW_DECL_POSIX_SPAWNP
293 _GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
294 "use gnulib module posix_spawnp for portability");
295 # endif
296 #endif
299 #if @GNULIB_POSIX_SPAWNATTR_INIT@
300 /* Initialize data structure with attributes for 'spawn' to default values. */
301 # if @REPLACE_POSIX_SPAWN@
302 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
303 # define posix_spawnattr_init rpl_posix_spawnattr_init
304 # endif
305 _GL_FUNCDECL_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
306 __THROW _GL_ARG_NONNULL ((1)));
307 _GL_CXXALIAS_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
308 # else
309 # if !@HAVE_POSIX_SPAWN@
310 _GL_FUNCDECL_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
311 __THROW _GL_ARG_NONNULL ((1)));
312 # endif
313 _GL_CXXALIAS_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
314 # endif
315 # if __GLIBC__ >= 2
316 _GL_CXXALIASWARN (posix_spawnattr_init);
317 # endif
318 #elif defined GNULIB_POSIXCHECK
319 # undef posix_spawnattr_init
320 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
321 _GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
322 "use gnulib module posix_spawnattr_init for portability");
323 # endif
324 #endif
326 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
327 /* Free resources associated with ATTR. */
328 # if @REPLACE_POSIX_SPAWN@
329 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
330 # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
331 # endif
332 _GL_FUNCDECL_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
333 __THROW _GL_ARG_NONNULL ((1)));
334 _GL_CXXALIAS_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
335 # else
336 # if !@HAVE_POSIX_SPAWN@
337 _GL_FUNCDECL_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
338 __THROW _GL_ARG_NONNULL ((1)));
339 # endif
340 _GL_CXXALIAS_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
341 # endif
342 # if __GLIBC__ >= 2
343 _GL_CXXALIASWARN (posix_spawnattr_destroy);
344 # endif
345 #elif defined GNULIB_POSIXCHECK
346 # undef posix_spawnattr_destroy
347 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
348 _GL_WARN_ON_USE (posix_spawnattr_destroy,
349 "posix_spawnattr_destroy is unportable - "
350 "use gnulib module posix_spawnattr_destroy for portability");
351 # endif
352 #endif
354 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
355 /* Store signal mask for signals with default handling from ATTR in
356 SIGDEFAULT. */
357 # if @REPLACE_POSIX_SPAWN@
358 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
359 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
360 # endif
361 _GL_FUNCDECL_RPL (posix_spawnattr_getsigdefault, int,
362 (const posix_spawnattr_t *_Restrict_ __attr,
363 sigset_t *_Restrict_ __sigdefault)
364 __THROW _GL_ARG_NONNULL ((1, 2)));
365 _GL_CXXALIAS_RPL (posix_spawnattr_getsigdefault, int,
366 (const posix_spawnattr_t *_Restrict_ __attr,
367 sigset_t *_Restrict_ __sigdefault));
368 # else
369 # if !@HAVE_POSIX_SPAWN@
370 _GL_FUNCDECL_SYS (posix_spawnattr_getsigdefault, int,
371 (const posix_spawnattr_t *_Restrict_ __attr,
372 sigset_t *_Restrict_ __sigdefault)
373 __THROW _GL_ARG_NONNULL ((1, 2)));
374 # endif
375 _GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault, int,
376 (const posix_spawnattr_t *_Restrict_ __attr,
377 sigset_t *_Restrict_ __sigdefault));
378 # endif
379 # if __GLIBC__ >= 2
380 _GL_CXXALIASWARN (posix_spawnattr_getsigdefault);
381 # endif
382 #elif defined GNULIB_POSIXCHECK
383 # undef posix_spawnattr_getsigdefault
384 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
385 _GL_WARN_ON_USE (posix_spawnattr_getsigdefault,
386 "posix_spawnattr_getsigdefault is unportable - "
387 "use gnulib module posix_spawnattr_getsigdefault for portability");
388 # endif
389 #endif
391 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
392 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
393 # if @REPLACE_POSIX_SPAWN@
394 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
395 # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
396 # endif
397 _GL_FUNCDECL_RPL (posix_spawnattr_setsigdefault, int,
398 (posix_spawnattr_t *_Restrict_ __attr,
399 const sigset_t *_Restrict_ __sigdefault)
400 __THROW _GL_ARG_NONNULL ((1, 2)));
401 _GL_CXXALIAS_RPL (posix_spawnattr_setsigdefault, int,
402 (posix_spawnattr_t *_Restrict_ __attr,
403 const sigset_t *_Restrict_ __sigdefault));
404 # else
405 # if !@HAVE_POSIX_SPAWN@
406 _GL_FUNCDECL_SYS (posix_spawnattr_setsigdefault, int,
407 (posix_spawnattr_t *_Restrict_ __attr,
408 const sigset_t *_Restrict_ __sigdefault)
409 __THROW _GL_ARG_NONNULL ((1, 2)));
410 # endif
411 _GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault, int,
412 (posix_spawnattr_t *_Restrict_ __attr,
413 const sigset_t *_Restrict_ __sigdefault));
414 # endif
415 # if __GLIBC__ >= 2
416 _GL_CXXALIASWARN (posix_spawnattr_setsigdefault);
417 # endif
418 #elif defined GNULIB_POSIXCHECK
419 # undef posix_spawnattr_setsigdefault
420 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
421 _GL_WARN_ON_USE (posix_spawnattr_setsigdefault,
422 "posix_spawnattr_setsigdefault is unportable - "
423 "use gnulib module posix_spawnattr_setsigdefault for portability");
424 # endif
425 #endif
427 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
428 /* Store signal mask for the new process from ATTR in SIGMASK. */
429 # if @REPLACE_POSIX_SPAWN@
430 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
431 # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
432 # endif
433 _GL_FUNCDECL_RPL (posix_spawnattr_getsigmask, int,
434 (const posix_spawnattr_t *_Restrict_ __attr,
435 sigset_t *_Restrict_ __sigmask)
436 __THROW _GL_ARG_NONNULL ((1, 2)));
437 _GL_CXXALIAS_RPL (posix_spawnattr_getsigmask, int,
438 (const posix_spawnattr_t *_Restrict_ __attr,
439 sigset_t *_Restrict_ __sigmask));
440 # else
441 # if !@HAVE_POSIX_SPAWN@
442 _GL_FUNCDECL_SYS (posix_spawnattr_getsigmask, int,
443 (const posix_spawnattr_t *_Restrict_ __attr,
444 sigset_t *_Restrict_ __sigmask)
445 __THROW _GL_ARG_NONNULL ((1, 2)));
446 # endif
447 _GL_CXXALIAS_SYS (posix_spawnattr_getsigmask, int,
448 (const posix_spawnattr_t *_Restrict_ __attr,
449 sigset_t *_Restrict_ __sigmask));
450 # endif
451 # if __GLIBC__ >= 2
452 _GL_CXXALIASWARN (posix_spawnattr_getsigmask);
453 # endif
454 #elif defined GNULIB_POSIXCHECK
455 # undef posix_spawnattr_getsigmask
456 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
457 _GL_WARN_ON_USE (posix_spawnattr_getsigmask,
458 "posix_spawnattr_getsigmask is unportable - "
459 "use gnulib module posix_spawnattr_getsigmask for portability");
460 # endif
461 #endif
463 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
464 /* Set signal mask for the new process in ATTR to SIGMASK. */
465 # if @REPLACE_POSIX_SPAWN@
466 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
467 # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
468 # endif
469 _GL_FUNCDECL_RPL (posix_spawnattr_setsigmask, int,
470 (posix_spawnattr_t *_Restrict_ __attr,
471 const sigset_t *_Restrict_ __sigmask)
472 __THROW _GL_ARG_NONNULL ((1, 2)));
473 _GL_CXXALIAS_RPL (posix_spawnattr_setsigmask, int,
474 (posix_spawnattr_t *_Restrict_ __attr,
475 const sigset_t *_Restrict_ __sigmask));
476 # else
477 # if !@HAVE_POSIX_SPAWN@
478 _GL_FUNCDECL_SYS (posix_spawnattr_setsigmask, int,
479 (posix_spawnattr_t *_Restrict_ __attr,
480 const sigset_t *_Restrict_ __sigmask)
481 __THROW _GL_ARG_NONNULL ((1, 2)));
482 # endif
483 _GL_CXXALIAS_SYS (posix_spawnattr_setsigmask, int,
484 (posix_spawnattr_t *_Restrict_ __attr,
485 const sigset_t *_Restrict_ __sigmask));
486 # endif
487 # if __GLIBC__ >= 2
488 _GL_CXXALIASWARN (posix_spawnattr_setsigmask);
489 # endif
490 #elif defined GNULIB_POSIXCHECK
491 # undef posix_spawnattr_setsigmask
492 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
493 _GL_WARN_ON_USE (posix_spawnattr_setsigmask,
494 "posix_spawnattr_setsigmask is unportable - "
495 "use gnulib module posix_spawnattr_setsigmask for portability");
496 # endif
497 #endif
499 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
500 /* Get flag word from the attribute structure. */
501 # if @REPLACE_POSIX_SPAWN@
502 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
503 # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
504 # endif
505 _GL_FUNCDECL_RPL (posix_spawnattr_getflags, int,
506 (const posix_spawnattr_t *_Restrict_ __attr,
507 short int *_Restrict_ __flags)
508 __THROW _GL_ARG_NONNULL ((1, 2)));
509 _GL_CXXALIAS_RPL (posix_spawnattr_getflags, int,
510 (const posix_spawnattr_t *_Restrict_ __attr,
511 short int *_Restrict_ __flags));
512 # else
513 # if !@HAVE_POSIX_SPAWN@
514 _GL_FUNCDECL_SYS (posix_spawnattr_getflags, int,
515 (const posix_spawnattr_t *_Restrict_ __attr,
516 short int *_Restrict_ __flags)
517 __THROW _GL_ARG_NONNULL ((1, 2)));
518 # endif
519 _GL_CXXALIAS_SYS (posix_spawnattr_getflags, int,
520 (const posix_spawnattr_t *_Restrict_ __attr,
521 short int *_Restrict_ __flags));
522 # endif
523 # if __GLIBC__ >= 2
524 _GL_CXXALIASWARN (posix_spawnattr_getflags);
525 # endif
526 #elif defined GNULIB_POSIXCHECK
527 # undef posix_spawnattr_getflags
528 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
529 _GL_WARN_ON_USE (posix_spawnattr_getflags,
530 "posix_spawnattr_getflags is unportable - "
531 "use gnulib module posix_spawnattr_getflags for portability");
532 # endif
533 #endif
535 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
536 /* Store flags in the attribute structure. */
537 # if @REPLACE_POSIX_SPAWN@
538 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
539 # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
540 # endif
541 _GL_FUNCDECL_RPL (posix_spawnattr_setflags, int,
542 (posix_spawnattr_t *__attr, short int __flags)
543 __THROW _GL_ARG_NONNULL ((1)));
544 _GL_CXXALIAS_RPL (posix_spawnattr_setflags, int,
545 (posix_spawnattr_t *__attr, short int __flags));
546 # else
547 # if !@HAVE_POSIX_SPAWN@
548 _GL_FUNCDECL_SYS (posix_spawnattr_setflags, int,
549 (posix_spawnattr_t *__attr, short int __flags)
550 __THROW _GL_ARG_NONNULL ((1)));
551 # endif
552 _GL_CXXALIAS_SYS (posix_spawnattr_setflags, int,
553 (posix_spawnattr_t *__attr, short int __flags));
554 # endif
555 # if __GLIBC__ >= 2
556 _GL_CXXALIASWARN (posix_spawnattr_setflags);
557 # endif
558 #elif defined GNULIB_POSIXCHECK
559 # undef posix_spawnattr_setflags
560 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
561 _GL_WARN_ON_USE (posix_spawnattr_setflags,
562 "posix_spawnattr_setflags is unportable - "
563 "use gnulib module posix_spawnattr_setflags for portability");
564 # endif
565 #endif
567 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
568 /* Get process group ID from the attribute structure. */
569 # if @REPLACE_POSIX_SPAWN@
570 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
571 # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
572 # endif
573 _GL_FUNCDECL_RPL (posix_spawnattr_getpgroup, int,
574 (const posix_spawnattr_t *_Restrict_ __attr,
575 pid_t *_Restrict_ __pgroup)
576 __THROW _GL_ARG_NONNULL ((1, 2)));
577 _GL_CXXALIAS_RPL (posix_spawnattr_getpgroup, int,
578 (const posix_spawnattr_t *_Restrict_ __attr,
579 pid_t *_Restrict_ __pgroup));
580 # else
581 # if !@HAVE_POSIX_SPAWN@
582 _GL_FUNCDECL_SYS (posix_spawnattr_getpgroup, int,
583 (const posix_spawnattr_t *_Restrict_ __attr,
584 pid_t *_Restrict_ __pgroup)
585 __THROW _GL_ARG_NONNULL ((1, 2)));
586 # endif
587 _GL_CXXALIAS_SYS (posix_spawnattr_getpgroup, int,
588 (const posix_spawnattr_t *_Restrict_ __attr,
589 pid_t *_Restrict_ __pgroup));
590 # endif
591 # if __GLIBC__ >= 2
592 _GL_CXXALIASWARN (posix_spawnattr_getpgroup);
593 # endif
594 #elif defined GNULIB_POSIXCHECK
595 # undef posix_spawnattr_getpgroup
596 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
597 _GL_WARN_ON_USE (posix_spawnattr_getpgroup,
598 "posix_spawnattr_getpgroup is unportable - "
599 "use gnulib module posix_spawnattr_getpgroup for portability");
600 # endif
601 #endif
603 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
604 /* Store process group ID in the attribute structure. */
605 # if @REPLACE_POSIX_SPAWN@
606 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
607 # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
608 # endif
609 _GL_FUNCDECL_RPL (posix_spawnattr_setpgroup, int,
610 (posix_spawnattr_t *__attr, pid_t __pgroup)
611 __THROW _GL_ARG_NONNULL ((1)));
612 _GL_CXXALIAS_RPL (posix_spawnattr_setpgroup, int,
613 (posix_spawnattr_t *__attr, pid_t __pgroup));
614 # else
615 # if !@HAVE_POSIX_SPAWN@
616 _GL_FUNCDECL_SYS (posix_spawnattr_setpgroup, int,
617 (posix_spawnattr_t *__attr, pid_t __pgroup)
618 __THROW _GL_ARG_NONNULL ((1)));
619 # endif
620 _GL_CXXALIAS_SYS (posix_spawnattr_setpgroup, int,
621 (posix_spawnattr_t *__attr, pid_t __pgroup));
622 # endif
623 # if __GLIBC__ >= 2
624 _GL_CXXALIASWARN (posix_spawnattr_setpgroup);
625 # endif
626 #elif defined GNULIB_POSIXCHECK
627 # undef posix_spawnattr_setpgroup
628 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
629 _GL_WARN_ON_USE (posix_spawnattr_setpgroup,
630 "posix_spawnattr_setpgroup is unportable - "
631 "use gnulib module posix_spawnattr_setpgroup for portability");
632 # endif
633 #endif
635 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
636 /* Get scheduling policy from the attribute structure. */
637 # if @REPLACE_POSIX_SPAWN@
638 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
639 # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
640 # endif
641 _GL_FUNCDECL_RPL (posix_spawnattr_getschedpolicy, int,
642 (const posix_spawnattr_t *_Restrict_ __attr,
643 int *_Restrict_ __schedpolicy)
644 __THROW _GL_ARG_NONNULL ((1, 2)));
645 _GL_CXXALIAS_RPL (posix_spawnattr_getschedpolicy, int,
646 (const posix_spawnattr_t *_Restrict_ __attr,
647 int *_Restrict_ __schedpolicy));
648 # else
649 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
650 _GL_FUNCDECL_SYS (posix_spawnattr_getschedpolicy, int,
651 (const posix_spawnattr_t *_Restrict_ __attr,
652 int *_Restrict_ __schedpolicy)
653 __THROW _GL_ARG_NONNULL ((1, 2)));
654 # endif
655 _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
656 (const posix_spawnattr_t *_Restrict_ __attr,
657 int *_Restrict_ __schedpolicy));
658 # endif
659 # if __GLIBC__ >= 2
660 _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
661 # endif
662 #elif defined GNULIB_POSIXCHECK
663 # undef posix_spawnattr_getschedpolicy
664 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
665 _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy,
666 "posix_spawnattr_getschedpolicy is unportable - "
667 "use gnulib module posix_spawnattr_getschedpolicy for portability");
668 # endif
669 #endif
671 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
672 /* Store scheduling policy in the attribute structure. */
673 # if @REPLACE_POSIX_SPAWN@
674 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
675 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
676 # endif
677 _GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy, int,
678 (posix_spawnattr_t *__attr, int __schedpolicy)
679 __THROW _GL_ARG_NONNULL ((1)));
680 _GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy, int,
681 (posix_spawnattr_t *__attr, int __schedpolicy));
682 # else
683 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
684 _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
685 (posix_spawnattr_t *__attr, int __schedpolicy)
686 __THROW _GL_ARG_NONNULL ((1)));
687 # endif
688 _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
689 (posix_spawnattr_t *__attr, int __schedpolicy));
690 # endif
691 # if __GLIBC__ >= 2
692 _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
693 # endif
694 #elif defined GNULIB_POSIXCHECK
695 # undef posix_spawnattr_setschedpolicy
696 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
697 _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy,
698 "posix_spawnattr_setschedpolicy is unportable - "
699 "use gnulib module posix_spawnattr_setschedpolicy for portability");
700 # endif
701 #endif
703 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
704 /* Get scheduling parameters from the attribute structure. */
705 # if @REPLACE_POSIX_SPAWN@
706 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
707 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
708 # endif
709 _GL_FUNCDECL_RPL (posix_spawnattr_getschedparam, int,
710 (const posix_spawnattr_t *_Restrict_ __attr,
711 struct sched_param *_Restrict_ __schedparam)
712 __THROW _GL_ARG_NONNULL ((1, 2)));
713 _GL_CXXALIAS_RPL (posix_spawnattr_getschedparam, int,
714 (const posix_spawnattr_t *_Restrict_ __attr,
715 struct sched_param *_Restrict_ __schedparam));
716 # else
717 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
718 _GL_FUNCDECL_SYS (posix_spawnattr_getschedparam, int,
719 (const posix_spawnattr_t *_Restrict_ __attr,
720 struct sched_param *_Restrict_ __schedparam)
721 __THROW _GL_ARG_NONNULL ((1, 2)));
722 # endif
723 _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
724 (const posix_spawnattr_t *_Restrict_ __attr,
725 struct sched_param *_Restrict_ __schedparam));
726 # endif
727 # if __GLIBC__ >= 2
728 _GL_CXXALIASWARN (posix_spawnattr_getschedparam);
729 # endif
730 #elif defined GNULIB_POSIXCHECK
731 # undef posix_spawnattr_getschedparam
732 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
733 _GL_WARN_ON_USE (posix_spawnattr_getschedparam,
734 "posix_spawnattr_getschedparam is unportable - "
735 "use gnulib module posix_spawnattr_getschedparam for portability");
736 # endif
737 #endif
739 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
740 /* Store scheduling parameters in the attribute structure. */
741 # if @REPLACE_POSIX_SPAWN@
742 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
743 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
744 # endif
745 _GL_FUNCDECL_RPL (posix_spawnattr_setschedparam, int,
746 (posix_spawnattr_t *_Restrict_ __attr,
747 const struct sched_param *_Restrict_ __schedparam)
748 __THROW _GL_ARG_NONNULL ((1, 2)));
749 _GL_CXXALIAS_RPL (posix_spawnattr_setschedparam, int,
750 (posix_spawnattr_t *_Restrict_ __attr,
751 const struct sched_param *_Restrict_ __schedparam));
752 # else
753 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
754 _GL_FUNCDECL_SYS (posix_spawnattr_setschedparam, int,
755 (posix_spawnattr_t *_Restrict_ __attr,
756 const struct sched_param *_Restrict_ __schedparam)
757 __THROW _GL_ARG_NONNULL ((1, 2)));
758 # endif
759 _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
760 (posix_spawnattr_t *_Restrict_ __attr,
761 const struct sched_param *_Restrict_ __schedparam));
762 # endif
763 # if __GLIBC__ >= 2
764 _GL_CXXALIASWARN (posix_spawnattr_setschedparam);
765 # endif
766 #elif defined GNULIB_POSIXCHECK
767 # undef posix_spawnattr_setschedparam
768 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
769 _GL_WARN_ON_USE (posix_spawnattr_setschedparam,
770 "posix_spawnattr_setschedparam is unportable - "
771 "use gnulib module posix_spawnattr_setschedparam for portability");
772 # endif
773 #endif
776 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
777 /* Initialize data structure for file attribute for 'spawn' call. */
778 # if @REPLACE_POSIX_SPAWN@
779 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
780 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
781 # endif
782 _GL_FUNCDECL_RPL (posix_spawn_file_actions_init, int,
783 (posix_spawn_file_actions_t *__file_actions)
784 __THROW _GL_ARG_NONNULL ((1)));
785 _GL_CXXALIAS_RPL (posix_spawn_file_actions_init, int,
786 (posix_spawn_file_actions_t *__file_actions));
787 # else
788 # if !@HAVE_POSIX_SPAWN@
789 _GL_FUNCDECL_SYS (posix_spawn_file_actions_init, int,
790 (posix_spawn_file_actions_t *__file_actions)
791 __THROW _GL_ARG_NONNULL ((1)));
792 # endif
793 _GL_CXXALIAS_SYS (posix_spawn_file_actions_init, int,
794 (posix_spawn_file_actions_t *__file_actions));
795 # endif
796 # if __GLIBC__ >= 2
797 _GL_CXXALIASWARN (posix_spawn_file_actions_init);
798 # endif
799 #elif defined GNULIB_POSIXCHECK
800 # undef posix_spawn_file_actions_init
801 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
802 _GL_WARN_ON_USE (posix_spawn_file_actions_init,
803 "posix_spawn_file_actions_init is unportable - "
804 "use gnulib module posix_spawn_file_actions_init for portability");
805 # endif
806 #endif
808 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
809 /* Free resources associated with FILE-ACTIONS. */
810 # if @REPLACE_POSIX_SPAWN@
811 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
812 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
813 # endif
814 _GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy, int,
815 (posix_spawn_file_actions_t *__file_actions)
816 __THROW _GL_ARG_NONNULL ((1)));
817 _GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy, int,
818 (posix_spawn_file_actions_t *__file_actions));
819 # else
820 # if !@HAVE_POSIX_SPAWN@
821 _GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy, int,
822 (posix_spawn_file_actions_t *__file_actions)
823 __THROW _GL_ARG_NONNULL ((1)));
824 # endif
825 _GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy, int,
826 (posix_spawn_file_actions_t *__file_actions));
827 # endif
828 # if __GLIBC__ >= 2
829 _GL_CXXALIASWARN (posix_spawn_file_actions_destroy);
830 # endif
831 #elif defined GNULIB_POSIXCHECK
832 # undef posix_spawn_file_actions_destroy
833 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
834 _GL_WARN_ON_USE (posix_spawn_file_actions_destroy,
835 "posix_spawn_file_actions_destroy is unportable - "
836 "use gnulib module posix_spawn_file_actions_destroy for portability");
837 # endif
838 #endif
840 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
841 /* Add an action to FILE-ACTIONS which tells the implementation to call
842 'open' for the given file during the 'spawn' call. */
843 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
844 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
845 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
846 # endif
847 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen, int,
848 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
849 int __fd,
850 const char *_Restrict_ __path, int __oflag, mode_t __mode)
851 __THROW _GL_ARG_NONNULL ((1, 3)));
852 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen, int,
853 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
854 int __fd,
855 const char *_Restrict_ __path, int __oflag, mode_t __mode));
856 # else
857 # if !@HAVE_POSIX_SPAWN@
858 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen, int,
859 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
860 int __fd,
861 const char *_Restrict_ __path, int __oflag, mode_t __mode)
862 __THROW _GL_ARG_NONNULL ((1, 3)));
863 # endif
864 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int,
865 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
866 int __fd,
867 const char *_Restrict_ __path, int __oflag, mode_t __mode));
868 # endif
869 # if __GLIBC__ >= 2
870 _GL_CXXALIASWARN (posix_spawn_file_actions_addopen);
871 # endif
872 #elif defined GNULIB_POSIXCHECK
873 # undef posix_spawn_file_actions_addopen
874 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
875 _GL_WARN_ON_USE (posix_spawn_file_actions_addopen,
876 "posix_spawn_file_actions_addopen is unportable - "
877 "use gnulib module posix_spawn_file_actions_addopen for portability");
878 # endif
879 #endif
881 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
882 /* Add an action to FILE-ACTIONS which tells the implementation to call
883 'close' for the given file descriptor during the 'spawn' call. */
884 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
885 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
886 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
887 # endif
888 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose, int,
889 (posix_spawn_file_actions_t *__file_actions, int __fd)
890 __THROW _GL_ARG_NONNULL ((1)));
891 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose, int,
892 (posix_spawn_file_actions_t *__file_actions, int __fd));
893 # else
894 # if !@HAVE_POSIX_SPAWN@
895 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int,
896 (posix_spawn_file_actions_t *__file_actions, int __fd)
897 __THROW _GL_ARG_NONNULL ((1)));
898 # endif
899 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int,
900 (posix_spawn_file_actions_t *__file_actions, int __fd));
901 # endif
902 # if __GLIBC__ >= 2
903 _GL_CXXALIASWARN (posix_spawn_file_actions_addclose);
904 # endif
905 #elif defined GNULIB_POSIXCHECK
906 # undef posix_spawn_file_actions_addclose
907 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
908 _GL_WARN_ON_USE (posix_spawn_file_actions_addclose,
909 "posix_spawn_file_actions_addclose is unportable - "
910 "use gnulib module posix_spawn_file_actions_addclose for portability");
911 # endif
912 #endif
914 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
915 /* Add an action to FILE-ACTIONS which tells the implementation to call
916 'dup2' for the given file descriptors during the 'spawn' call. */
917 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
918 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
919 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
920 # endif
921 _GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2, int,
922 (posix_spawn_file_actions_t *__file_actions,
923 int __fd, int __newfd)
924 __THROW _GL_ARG_NONNULL ((1)));
925 _GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2, int,
926 (posix_spawn_file_actions_t *__file_actions,
927 int __fd, int __newfd));
928 # else
929 # if !@HAVE_POSIX_SPAWN@
930 _GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2, int,
931 (posix_spawn_file_actions_t *__file_actions,
932 int __fd, int __newfd)
933 __THROW _GL_ARG_NONNULL ((1)));
934 # endif
935 _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int,
936 (posix_spawn_file_actions_t *__file_actions,
937 int __fd, int __newfd));
938 # endif
939 # if __GLIBC__ >= 2
940 _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2);
941 # endif
942 #elif defined GNULIB_POSIXCHECK
943 # undef posix_spawn_file_actions_adddup2
944 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
945 _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2,
946 "posix_spawn_file_actions_adddup2 is unportable - "
947 "use gnulib module posix_spawn_file_actions_adddup2 for portability");
948 # endif
949 #endif
951 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
952 /* Add an action to FILE-ACTIONS which tells the implementation to call
953 'chdir' to the given directory during the 'spawn' call. */
954 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
955 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
956 # define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir
957 # endif
958 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir, int,
959 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
960 const char *_Restrict_ __path)
961 __THROW _GL_ARG_NONNULL ((1, 2)));
962 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir, int,
963 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
964 const char *_Restrict_ __path));
965 # else
966 # if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
967 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir, int,
968 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
969 const char *_Restrict_ __path)
970 __THROW _GL_ARG_NONNULL ((1, 2)));
971 # endif
972 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir, int,
973 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
974 const char *_Restrict_ __path));
975 # endif
976 # if __GLIBC__ >= 2
977 _GL_CXXALIASWARN (posix_spawn_file_actions_addchdir);
978 # endif
979 #elif defined GNULIB_POSIXCHECK
980 # undef posix_spawn_file_actions_addchdir
981 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
982 _GL_WARN_ON_USE (posix_spawn_file_actions_addchdir,
983 "posix_spawn_file_actions_addchdir is unportable - "
984 "use gnulib module posix_spawn_file_actions_addchdir for portability");
985 # endif
986 #endif
988 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
989 /* Add an action to FILE-ACTIONS which tells the implementation to call
990 'fchdir' to the given directory during the 'spawn' call. */
991 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
992 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
993 # define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir
994 # endif
995 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int,
996 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
997 int __fd)
998 __THROW _GL_ARG_NONNULL ((1)));
999 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int,
1000 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
1001 int __fd));
1002 # else
1003 # if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
1004 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int,
1005 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
1006 int __fd)
1007 __THROW _GL_ARG_NONNULL ((1)));
1008 # endif
1009 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int,
1010 (posix_spawn_file_actions_t *_Restrict_ __file_actions,
1011 int __fd));
1012 # endif
1013 # if __GLIBC__ >= 2
1014 _GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir);
1015 # endif
1016 #elif defined GNULIB_POSIXCHECK
1017 # undef posix_spawn_file_actions_addfchdir
1018 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
1019 _GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
1020 "posix_spawn_file_actions_addfchdir is unportable - "
1021 "use gnulib module posix_spawn_file_actions_addfchdir for portability");
1022 # endif
1023 #endif
1026 #endif /* _@GUARD_PREFIX@_SPAWN_H */
1027 #endif /* _@GUARD_PREFIX@_SPAWN_H */
1028 #endif