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