1 /* Definitions for POSIX spawn interface.
2 Copyright (C) 2000, 2003-2004, 2008-2019 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
21 @PRAGMA_SYSTEM_HEADER@
25 /* The include_next requires a split double-inclusion guard. */
27 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
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__)
40 #include <sys/types.h>
46 /* GCC 2.95 and later have "__restrict"; C99 compilers have
47 "restrict", and "configure" may have defined "restrict".
48 Other compilers use __restrict, __restrict__, and _Restrict, and
49 'configure' might #define 'restrict' to those words, so pick a
52 # if 199901L <= __STDC_VERSION__
53 # define _Restrict_ restrict
54 # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
55 # define _Restrict_ __restrict
60 /* gcc 3.1 and up support the [restrict] syntax. Don't trust
61 sys/cdefs.h's definition of __restrict_arr, though, as it
62 mishandles gcc -ansi -pedantic. */
63 #ifndef _Restrict_arr_
64 # if ((199901L <= __STDC_VERSION__ \
65 || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
66 && !defined __STRICT_ANSI__)) \
68 # define _Restrict_arr_ _Restrict_
70 # define _Restrict_arr_
74 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
76 /* The definition of _GL_ARG_NONNULL is copied here. */
78 /* The definition of _GL_WARN_ON_USE is copied here. */
81 /* Data structure to contain attributes for thread creation. */
82 #if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWNATTR_T@ && !@HAVE_POSIX_SPAWN@)
83 # define posix_spawnattr_t rpl_posix_spawnattr_t
85 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@ || !@HAVE_POSIX_SPAWN@
86 # if !GNULIB_defined_posix_spawnattr_t
93 struct sched_param _sp
;
97 # define GNULIB_defined_posix_spawnattr_t 1
102 /* Data structure to contain information about the actions to be
103 performed in the new process with respect to file descriptors. */
104 #if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ && !@HAVE_POSIX_SPAWN@)
105 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
107 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ || !@HAVE_POSIX_SPAWN@
108 # if !GNULIB_defined_posix_spawn_file_actions_t
113 struct __spawn_action
*_actions
;
115 } posix_spawn_file_actions_t
;
116 # define GNULIB_defined_posix_spawn_file_actions_t 1
121 /* Flags to be set in the 'posix_spawnattr_t'. */
122 #if @HAVE_POSIX_SPAWN@
123 /* Use the values from the system, but provide the missing ones. */
124 # ifndef POSIX_SPAWN_SETSCHEDPARAM
125 # define POSIX_SPAWN_SETSCHEDPARAM 0
127 # ifndef POSIX_SPAWN_SETSCHEDULER
128 # define POSIX_SPAWN_SETSCHEDULER 0
131 # if @REPLACE_POSIX_SPAWN@
132 /* Use the values from the system, for better compatibility. */
133 /* But this implementation does not support AIX extensions. */
134 # undef POSIX_SPAWN_FORK_HANDLERS
136 # define POSIX_SPAWN_RESETIDS 0x01
137 # define POSIX_SPAWN_SETPGROUP 0x02
138 # define POSIX_SPAWN_SETSIGDEF 0x04
139 # define POSIX_SPAWN_SETSIGMASK 0x08
140 # define POSIX_SPAWN_SETSCHEDPARAM 0x10
141 # define POSIX_SPAWN_SETSCHEDULER 0x20
144 /* A GNU extension. Use the next free bit position. */
145 #ifndef POSIX_SPAWN_USEVFORK
146 # define POSIX_SPAWN_USEVFORK \
147 ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
148 | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
149 | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
150 | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
151 | POSIX_SPAWN_SETSCHEDPARAM \
152 | (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
153 | POSIX_SPAWN_SETSCHEDULER \
154 | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
157 #if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
158 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
159 [(((POSIX_SPAWN_RESETIDS
| POSIX_SPAWN_SETPGROUP
160 | POSIX_SPAWN_SETSIGDEF
| POSIX_SPAWN_SETSIGMASK
161 | POSIX_SPAWN_SETSCHEDPARAM
| POSIX_SPAWN_SETSCHEDULER
)
162 & POSIX_SPAWN_USEVFORK
)
165 # define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
169 #if @GNULIB_POSIX_SPAWN@
170 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
171 Before running the process perform the actions described in FILE-ACTIONS.
173 This function is a possible cancellation points and therefore not
174 marked with __THROW. */
175 # if @REPLACE_POSIX_SPAWN@
176 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
177 # define posix_spawn rpl_posix_spawn
179 _GL_FUNCDECL_RPL (posix_spawn
, int,
180 (pid_t
*_Restrict_ __pid
,
181 const char *_Restrict_ __path
,
182 const posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
183 const posix_spawnattr_t
*_Restrict_ __attrp
,
184 char *const argv
[_Restrict_arr_
],
185 char *const envp
[_Restrict_arr_
])
186 _GL_ARG_NONNULL ((2, 5, 6)));
187 _GL_CXXALIAS_RPL (posix_spawn
, int,
188 (pid_t
*_Restrict_ __pid
,
189 const char *_Restrict_ __path
,
190 const posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
191 const posix_spawnattr_t
*_Restrict_ __attrp
,
192 char *const argv
[_Restrict_arr_
],
193 char *const envp
[_Restrict_arr_
]));
195 # if !@HAVE_POSIX_SPAWN@
196 _GL_FUNCDECL_SYS (posix_spawn
, int,
197 (pid_t
*_Restrict_ __pid
,
198 const char *_Restrict_ __path
,
199 const posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
200 const posix_spawnattr_t
*_Restrict_ __attrp
,
201 char *const argv
[_Restrict_arr_
],
202 char *const envp
[_Restrict_arr_
])
203 _GL_ARG_NONNULL ((2, 5, 6)));
205 _GL_CXXALIAS_SYS (posix_spawn
, int,
206 (pid_t
*_Restrict_ __pid
,
207 const char *_Restrict_ __path
,
208 const posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
209 const posix_spawnattr_t
*_Restrict_ __attrp
,
210 char *const argv
[_Restrict_arr_
],
211 char *const envp
[_Restrict_arr_
]));
213 _GL_CXXALIASWARN (posix_spawn
);
214 #elif defined GNULIB_POSIXCHECK
216 # if HAVE_RAW_DECL_POSIX_SPAWN
217 _GL_WARN_ON_USE (posix_spawn
, "posix_spawn is unportable - "
218 "use gnulib module posix_spawn for portability");
222 #if @GNULIB_POSIX_SPAWNP@
223 /* Similar to 'posix_spawn' but search for FILE in the PATH.
225 This function is a possible cancellation points and therefore not
226 marked with __THROW. */
227 # if @REPLACE_POSIX_SPAWN@
228 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
229 # define posix_spawnp rpl_posix_spawnp
231 _GL_FUNCDECL_RPL (posix_spawnp
, int,
232 (pid_t
*__pid
, const char *__file
,
233 const posix_spawn_file_actions_t
*__file_actions
,
234 const posix_spawnattr_t
*__attrp
,
235 char *const argv
[], char *const envp
[])
236 _GL_ARG_NONNULL ((2, 5, 6)));
237 _GL_CXXALIAS_RPL (posix_spawnp
, int,
238 (pid_t
*__pid
, const char *__file
,
239 const posix_spawn_file_actions_t
*__file_actions
,
240 const posix_spawnattr_t
*__attrp
,
241 char *const argv
[], char *const envp
[]));
243 # if !@HAVE_POSIX_SPAWN@
244 _GL_FUNCDECL_SYS (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 _GL_ARG_NONNULL ((2, 5, 6)));
251 _GL_CXXALIAS_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
[]));
257 _GL_CXXALIASWARN (posix_spawnp
);
258 #elif defined GNULIB_POSIXCHECK
260 # if HAVE_RAW_DECL_POSIX_SPAWNP
261 _GL_WARN_ON_USE (posix_spawnp
, "posix_spawnp is unportable - "
262 "use gnulib module posix_spawnp for portability");
267 #if @GNULIB_POSIX_SPAWNATTR_INIT@
268 /* Initialize data structure with attributes for 'spawn' to default values. */
269 # if @REPLACE_POSIX_SPAWN@
270 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
271 # define posix_spawnattr_init rpl_posix_spawnattr_init
273 _GL_FUNCDECL_RPL (posix_spawnattr_init
, int, (posix_spawnattr_t
*__attr
)
274 __THROW
_GL_ARG_NONNULL ((1)));
275 _GL_CXXALIAS_RPL (posix_spawnattr_init
, int, (posix_spawnattr_t
*__attr
));
277 # if !@HAVE_POSIX_SPAWN@
278 _GL_FUNCDECL_SYS (posix_spawnattr_init
, int, (posix_spawnattr_t
*__attr
)
279 __THROW
_GL_ARG_NONNULL ((1)));
281 _GL_CXXALIAS_SYS (posix_spawnattr_init
, int, (posix_spawnattr_t
*__attr
));
283 _GL_CXXALIASWARN (posix_spawnattr_init
);
284 #elif defined GNULIB_POSIXCHECK
285 # undef posix_spawnattr_init
286 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
287 _GL_WARN_ON_USE (posix_spawnattr_init
, "posix_spawnattr_init is unportable - "
288 "use gnulib module posix_spawnattr_init for portability");
292 #if @GNULIB_POSIX_SPAWNATTR_DESTROY@
293 /* Free resources associated with ATTR. */
294 # if @REPLACE_POSIX_SPAWN@
295 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
296 # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
298 _GL_FUNCDECL_RPL (posix_spawnattr_destroy
, int, (posix_spawnattr_t
*__attr
)
299 __THROW
_GL_ARG_NONNULL ((1)));
300 _GL_CXXALIAS_RPL (posix_spawnattr_destroy
, int, (posix_spawnattr_t
*__attr
));
302 # if !@HAVE_POSIX_SPAWN@
303 _GL_FUNCDECL_SYS (posix_spawnattr_destroy
, int, (posix_spawnattr_t
*__attr
)
304 __THROW
_GL_ARG_NONNULL ((1)));
306 _GL_CXXALIAS_SYS (posix_spawnattr_destroy
, int, (posix_spawnattr_t
*__attr
));
308 _GL_CXXALIASWARN (posix_spawnattr_destroy
);
309 #elif defined GNULIB_POSIXCHECK
310 # undef posix_spawnattr_destroy
311 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
312 _GL_WARN_ON_USE (posix_spawnattr_destroy
,
313 "posix_spawnattr_destroy is unportable - "
314 "use gnulib module posix_spawnattr_destroy for portability");
318 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
319 /* Store signal mask for signals with default handling from ATTR in
321 # if @REPLACE_POSIX_SPAWN@
322 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
323 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
325 _GL_FUNCDECL_RPL (posix_spawnattr_getsigdefault
, int,
326 (const posix_spawnattr_t
*_Restrict_ __attr
,
327 sigset_t
*_Restrict_ __sigdefault
)
328 __THROW
_GL_ARG_NONNULL ((1, 2)));
329 _GL_CXXALIAS_RPL (posix_spawnattr_getsigdefault
, int,
330 (const posix_spawnattr_t
*_Restrict_ __attr
,
331 sigset_t
*_Restrict_ __sigdefault
));
333 # if !@HAVE_POSIX_SPAWN@
334 _GL_FUNCDECL_SYS (posix_spawnattr_getsigdefault
, int,
335 (const posix_spawnattr_t
*_Restrict_ __attr
,
336 sigset_t
*_Restrict_ __sigdefault
)
337 __THROW
_GL_ARG_NONNULL ((1, 2)));
339 _GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault
, int,
340 (const posix_spawnattr_t
*_Restrict_ __attr
,
341 sigset_t
*_Restrict_ __sigdefault
));
343 _GL_CXXALIASWARN (posix_spawnattr_getsigdefault
);
344 #elif defined GNULIB_POSIXCHECK
345 # undef posix_spawnattr_getsigdefault
346 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
347 _GL_WARN_ON_USE (posix_spawnattr_getsigdefault
,
348 "posix_spawnattr_getsigdefault is unportable - "
349 "use gnulib module posix_spawnattr_getsigdefault for portability");
353 #if @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
354 /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
355 # if @REPLACE_POSIX_SPAWN@
356 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
357 # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
359 _GL_FUNCDECL_RPL (posix_spawnattr_setsigdefault
, int,
360 (posix_spawnattr_t
*_Restrict_ __attr
,
361 const sigset_t
*_Restrict_ __sigdefault
)
362 __THROW
_GL_ARG_NONNULL ((1, 2)));
363 _GL_CXXALIAS_RPL (posix_spawnattr_setsigdefault
, int,
364 (posix_spawnattr_t
*_Restrict_ __attr
,
365 const sigset_t
*_Restrict_ __sigdefault
));
367 # if !@HAVE_POSIX_SPAWN@
368 _GL_FUNCDECL_SYS (posix_spawnattr_setsigdefault
, int,
369 (posix_spawnattr_t
*_Restrict_ __attr
,
370 const sigset_t
*_Restrict_ __sigdefault
)
371 __THROW
_GL_ARG_NONNULL ((1, 2)));
373 _GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault
, int,
374 (posix_spawnattr_t
*_Restrict_ __attr
,
375 const sigset_t
*_Restrict_ __sigdefault
));
377 _GL_CXXALIASWARN (posix_spawnattr_setsigdefault
);
378 #elif defined GNULIB_POSIXCHECK
379 # undef posix_spawnattr_setsigdefault
380 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
381 _GL_WARN_ON_USE (posix_spawnattr_setsigdefault
,
382 "posix_spawnattr_setsigdefault is unportable - "
383 "use gnulib module posix_spawnattr_setsigdefault for portability");
387 #if @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
388 /* Store signal mask for the new process from ATTR in SIGMASK. */
389 # if @REPLACE_POSIX_SPAWN@
390 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
391 # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
393 _GL_FUNCDECL_RPL (posix_spawnattr_getsigmask
, int,
394 (const posix_spawnattr_t
*_Restrict_ __attr
,
395 sigset_t
*_Restrict_ __sigmask
)
396 __THROW
_GL_ARG_NONNULL ((1, 2)));
397 _GL_CXXALIAS_RPL (posix_spawnattr_getsigmask
, int,
398 (const posix_spawnattr_t
*_Restrict_ __attr
,
399 sigset_t
*_Restrict_ __sigmask
));
401 # if !@HAVE_POSIX_SPAWN@
402 _GL_FUNCDECL_SYS (posix_spawnattr_getsigmask
, int,
403 (const posix_spawnattr_t
*_Restrict_ __attr
,
404 sigset_t
*_Restrict_ __sigmask
)
405 __THROW
_GL_ARG_NONNULL ((1, 2)));
407 _GL_CXXALIAS_SYS (posix_spawnattr_getsigmask
, int,
408 (const posix_spawnattr_t
*_Restrict_ __attr
,
409 sigset_t
*_Restrict_ __sigmask
));
411 _GL_CXXALIASWARN (posix_spawnattr_getsigmask
);
412 #elif defined GNULIB_POSIXCHECK
413 # undef posix_spawnattr_getsigmask
414 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
415 _GL_WARN_ON_USE (posix_spawnattr_getsigmask
,
416 "posix_spawnattr_getsigmask is unportable - "
417 "use gnulib module posix_spawnattr_getsigmask for portability");
421 #if @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
422 /* Set signal mask for the new process in ATTR to SIGMASK. */
423 # if @REPLACE_POSIX_SPAWN@
424 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
425 # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
427 _GL_FUNCDECL_RPL (posix_spawnattr_setsigmask
, int,
428 (posix_spawnattr_t
*_Restrict_ __attr
,
429 const sigset_t
*_Restrict_ __sigmask
)
430 __THROW
_GL_ARG_NONNULL ((1, 2)));
431 _GL_CXXALIAS_RPL (posix_spawnattr_setsigmask
, int,
432 (posix_spawnattr_t
*_Restrict_ __attr
,
433 const sigset_t
*_Restrict_ __sigmask
));
435 # if !@HAVE_POSIX_SPAWN@
436 _GL_FUNCDECL_SYS (posix_spawnattr_setsigmask
, int,
437 (posix_spawnattr_t
*_Restrict_ __attr
,
438 const sigset_t
*_Restrict_ __sigmask
)
439 __THROW
_GL_ARG_NONNULL ((1, 2)));
441 _GL_CXXALIAS_SYS (posix_spawnattr_setsigmask
, int,
442 (posix_spawnattr_t
*_Restrict_ __attr
,
443 const sigset_t
*_Restrict_ __sigmask
));
445 _GL_CXXALIASWARN (posix_spawnattr_setsigmask
);
446 #elif defined GNULIB_POSIXCHECK
447 # undef posix_spawnattr_setsigmask
448 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
449 _GL_WARN_ON_USE (posix_spawnattr_setsigmask
,
450 "posix_spawnattr_setsigmask is unportable - "
451 "use gnulib module posix_spawnattr_setsigmask for portability");
455 #if @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
456 /* Get flag word from the attribute structure. */
457 # if @REPLACE_POSIX_SPAWN@
458 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
459 # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
461 _GL_FUNCDECL_RPL (posix_spawnattr_getflags
, int,
462 (const posix_spawnattr_t
*_Restrict_ __attr
,
463 short int *_Restrict_ __flags
)
464 __THROW
_GL_ARG_NONNULL ((1, 2)));
465 _GL_CXXALIAS_RPL (posix_spawnattr_getflags
, int,
466 (const posix_spawnattr_t
*_Restrict_ __attr
,
467 short int *_Restrict_ __flags
));
469 # if !@HAVE_POSIX_SPAWN@
470 _GL_FUNCDECL_SYS (posix_spawnattr_getflags
, int,
471 (const posix_spawnattr_t
*_Restrict_ __attr
,
472 short int *_Restrict_ __flags
)
473 __THROW
_GL_ARG_NONNULL ((1, 2)));
475 _GL_CXXALIAS_SYS (posix_spawnattr_getflags
, int,
476 (const posix_spawnattr_t
*_Restrict_ __attr
,
477 short int *_Restrict_ __flags
));
479 _GL_CXXALIASWARN (posix_spawnattr_getflags
);
480 #elif defined GNULIB_POSIXCHECK
481 # undef posix_spawnattr_getflags
482 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
483 _GL_WARN_ON_USE (posix_spawnattr_getflags
,
484 "posix_spawnattr_getflags is unportable - "
485 "use gnulib module posix_spawnattr_getflags for portability");
489 #if @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
490 /* Store flags in the attribute structure. */
491 # if @REPLACE_POSIX_SPAWN@
492 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
493 # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
495 _GL_FUNCDECL_RPL (posix_spawnattr_setflags
, int,
496 (posix_spawnattr_t
*__attr
, short int __flags
)
497 __THROW
_GL_ARG_NONNULL ((1)));
498 _GL_CXXALIAS_RPL (posix_spawnattr_setflags
, int,
499 (posix_spawnattr_t
*__attr
, short int __flags
));
501 # if !@HAVE_POSIX_SPAWN@
502 _GL_FUNCDECL_SYS (posix_spawnattr_setflags
, int,
503 (posix_spawnattr_t
*__attr
, short int __flags
)
504 __THROW
_GL_ARG_NONNULL ((1)));
506 _GL_CXXALIAS_SYS (posix_spawnattr_setflags
, int,
507 (posix_spawnattr_t
*__attr
, short int __flags
));
509 _GL_CXXALIASWARN (posix_spawnattr_setflags
);
510 #elif defined GNULIB_POSIXCHECK
511 # undef posix_spawnattr_setflags
512 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
513 _GL_WARN_ON_USE (posix_spawnattr_setflags
,
514 "posix_spawnattr_setflags is unportable - "
515 "use gnulib module posix_spawnattr_setflags for portability");
519 #if @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
520 /* Get process group ID from the attribute structure. */
521 # if @REPLACE_POSIX_SPAWN@
522 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
523 # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
525 _GL_FUNCDECL_RPL (posix_spawnattr_getpgroup
, int,
526 (const posix_spawnattr_t
*_Restrict_ __attr
,
527 pid_t
*_Restrict_ __pgroup
)
528 __THROW
_GL_ARG_NONNULL ((1, 2)));
529 _GL_CXXALIAS_RPL (posix_spawnattr_getpgroup
, int,
530 (const posix_spawnattr_t
*_Restrict_ __attr
,
531 pid_t
*_Restrict_ __pgroup
));
533 # if !@HAVE_POSIX_SPAWN@
534 _GL_FUNCDECL_SYS (posix_spawnattr_getpgroup
, int,
535 (const posix_spawnattr_t
*_Restrict_ __attr
,
536 pid_t
*_Restrict_ __pgroup
)
537 __THROW
_GL_ARG_NONNULL ((1, 2)));
539 _GL_CXXALIAS_SYS (posix_spawnattr_getpgroup
, int,
540 (const posix_spawnattr_t
*_Restrict_ __attr
,
541 pid_t
*_Restrict_ __pgroup
));
543 _GL_CXXALIASWARN (posix_spawnattr_getpgroup
);
544 #elif defined GNULIB_POSIXCHECK
545 # undef posix_spawnattr_getpgroup
546 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
547 _GL_WARN_ON_USE (posix_spawnattr_getpgroup
,
548 "posix_spawnattr_getpgroup is unportable - "
549 "use gnulib module posix_spawnattr_getpgroup for portability");
553 #if @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
554 /* Store process group ID in the attribute structure. */
555 # if @REPLACE_POSIX_SPAWN@
556 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
557 # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
559 _GL_FUNCDECL_RPL (posix_spawnattr_setpgroup
, int,
560 (posix_spawnattr_t
*__attr
, pid_t __pgroup
)
561 __THROW
_GL_ARG_NONNULL ((1)));
562 _GL_CXXALIAS_RPL (posix_spawnattr_setpgroup
, int,
563 (posix_spawnattr_t
*__attr
, pid_t __pgroup
));
565 # if !@HAVE_POSIX_SPAWN@
566 _GL_FUNCDECL_SYS (posix_spawnattr_setpgroup
, int,
567 (posix_spawnattr_t
*__attr
, pid_t __pgroup
)
568 __THROW
_GL_ARG_NONNULL ((1)));
570 _GL_CXXALIAS_SYS (posix_spawnattr_setpgroup
, int,
571 (posix_spawnattr_t
*__attr
, pid_t __pgroup
));
573 _GL_CXXALIASWARN (posix_spawnattr_setpgroup
);
574 #elif defined GNULIB_POSIXCHECK
575 # undef posix_spawnattr_setpgroup
576 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
577 _GL_WARN_ON_USE (posix_spawnattr_setpgroup
,
578 "posix_spawnattr_setpgroup is unportable - "
579 "use gnulib module posix_spawnattr_setpgroup for portability");
583 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
584 /* Get scheduling policy from the attribute structure. */
585 # if @REPLACE_POSIX_SPAWN@
586 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
587 # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
589 _GL_FUNCDECL_RPL (posix_spawnattr_getschedpolicy
, int,
590 (const posix_spawnattr_t
*_Restrict_ __attr
,
591 int *_Restrict_ __schedpolicy
)
592 __THROW
_GL_ARG_NONNULL ((1, 2)));
593 _GL_CXXALIAS_RPL (posix_spawnattr_getschedpolicy
, int,
594 (const posix_spawnattr_t
*_Restrict_ __attr
,
595 int *_Restrict_ __schedpolicy
));
597 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
598 _GL_FUNCDECL_SYS (posix_spawnattr_getschedpolicy
, int,
599 (const posix_spawnattr_t
*_Restrict_ __attr
,
600 int *_Restrict_ __schedpolicy
)
601 __THROW
_GL_ARG_NONNULL ((1, 2)));
603 _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy
, int,
604 (const posix_spawnattr_t
*_Restrict_ __attr
,
605 int *_Restrict_ __schedpolicy
));
607 _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy
);
608 #elif defined GNULIB_POSIXCHECK
609 # undef posix_spawnattr_getschedpolicy
610 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
611 _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy
,
612 "posix_spawnattr_getschedpolicy is unportable - "
613 "use gnulib module posix_spawnattr_getschedpolicy for portability");
617 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
618 /* Store scheduling policy in the attribute structure. */
619 # if @REPLACE_POSIX_SPAWN@
620 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
621 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
623 _GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy
, int,
624 (posix_spawnattr_t
*__attr
, int __schedpolicy
)
625 __THROW
_GL_ARG_NONNULL ((1)));
626 _GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy
, int,
627 (posix_spawnattr_t
*__attr
, int __schedpolicy
));
629 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0
630 _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy
, int,
631 (posix_spawnattr_t
*__attr
, int __schedpolicy
)
632 __THROW
_GL_ARG_NONNULL ((1)));
634 _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy
, int,
635 (posix_spawnattr_t
*__attr
, int __schedpolicy
));
637 _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy
);
638 #elif defined GNULIB_POSIXCHECK
639 # undef posix_spawnattr_setschedpolicy
640 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
641 _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy
,
642 "posix_spawnattr_setschedpolicy is unportable - "
643 "use gnulib module posix_spawnattr_setschedpolicy for portability");
647 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
648 /* Get scheduling parameters from the attribute structure. */
649 # if @REPLACE_POSIX_SPAWN@
650 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
651 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
653 _GL_FUNCDECL_RPL (posix_spawnattr_getschedparam
, int,
654 (const posix_spawnattr_t
*_Restrict_ __attr
,
655 struct sched_param
*_Restrict_ __schedparam
)
656 __THROW
_GL_ARG_NONNULL ((1, 2)));
657 _GL_CXXALIAS_RPL (posix_spawnattr_getschedparam
, int,
658 (const posix_spawnattr_t
*_Restrict_ __attr
,
659 struct sched_param
*_Restrict_ __schedparam
));
661 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
662 _GL_FUNCDECL_SYS (posix_spawnattr_getschedparam
, int,
663 (const posix_spawnattr_t
*_Restrict_ __attr
,
664 struct sched_param
*_Restrict_ __schedparam
)
665 __THROW
_GL_ARG_NONNULL ((1, 2)));
667 _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam
, int,
668 (const posix_spawnattr_t
*_Restrict_ __attr
,
669 struct sched_param
*_Restrict_ __schedparam
));
671 _GL_CXXALIASWARN (posix_spawnattr_getschedparam
);
672 #elif defined GNULIB_POSIXCHECK
673 # undef posix_spawnattr_getschedparam
674 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
675 _GL_WARN_ON_USE (posix_spawnattr_getschedparam
,
676 "posix_spawnattr_getschedparam is unportable - "
677 "use gnulib module posix_spawnattr_getschedparam for portability");
681 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
682 /* Store scheduling parameters in the attribute structure. */
683 # if @REPLACE_POSIX_SPAWN@
684 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
685 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
687 _GL_FUNCDECL_RPL (posix_spawnattr_setschedparam
, int,
688 (posix_spawnattr_t
*_Restrict_ __attr
,
689 const struct sched_param
*_Restrict_ __schedparam
)
690 __THROW
_GL_ARG_NONNULL ((1, 2)));
691 _GL_CXXALIAS_RPL (posix_spawnattr_setschedparam
, int,
692 (posix_spawnattr_t
*_Restrict_ __attr
,
693 const struct sched_param
*_Restrict_ __schedparam
));
695 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0
696 _GL_FUNCDECL_SYS (posix_spawnattr_setschedparam
, int,
697 (posix_spawnattr_t
*_Restrict_ __attr
,
698 const struct sched_param
*_Restrict_ __schedparam
)
699 __THROW
_GL_ARG_NONNULL ((1, 2)));
701 _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam
, int,
702 (posix_spawnattr_t
*_Restrict_ __attr
,
703 const struct sched_param
*_Restrict_ __schedparam
));
705 _GL_CXXALIASWARN (posix_spawnattr_setschedparam
);
706 #elif defined GNULIB_POSIXCHECK
707 # undef posix_spawnattr_setschedparam
708 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
709 _GL_WARN_ON_USE (posix_spawnattr_setschedparam
,
710 "posix_spawnattr_setschedparam is unportable - "
711 "use gnulib module posix_spawnattr_setschedparam for portability");
716 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
717 /* Initialize data structure for file attribute for 'spawn' call. */
718 # if @REPLACE_POSIX_SPAWN@
719 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
720 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
722 _GL_FUNCDECL_RPL (posix_spawn_file_actions_init
, int,
723 (posix_spawn_file_actions_t
*__file_actions
)
724 __THROW
_GL_ARG_NONNULL ((1)));
725 _GL_CXXALIAS_RPL (posix_spawn_file_actions_init
, int,
726 (posix_spawn_file_actions_t
*__file_actions
));
728 # if !@HAVE_POSIX_SPAWN@
729 _GL_FUNCDECL_SYS (posix_spawn_file_actions_init
, int,
730 (posix_spawn_file_actions_t
*__file_actions
)
731 __THROW
_GL_ARG_NONNULL ((1)));
733 _GL_CXXALIAS_SYS (posix_spawn_file_actions_init
, int,
734 (posix_spawn_file_actions_t
*__file_actions
));
736 _GL_CXXALIASWARN (posix_spawn_file_actions_init
);
737 #elif defined GNULIB_POSIXCHECK
738 # undef posix_spawn_file_actions_init
739 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
740 _GL_WARN_ON_USE (posix_spawn_file_actions_init
,
741 "posix_spawn_file_actions_init is unportable - "
742 "use gnulib module posix_spawn_file_actions_init for portability");
746 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
747 /* Free resources associated with FILE-ACTIONS. */
748 # if @REPLACE_POSIX_SPAWN@
749 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
750 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
752 _GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy
, int,
753 (posix_spawn_file_actions_t
*__file_actions
)
754 __THROW
_GL_ARG_NONNULL ((1)));
755 _GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy
, int,
756 (posix_spawn_file_actions_t
*__file_actions
));
758 # if !@HAVE_POSIX_SPAWN@
759 _GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy
, int,
760 (posix_spawn_file_actions_t
*__file_actions
)
761 __THROW
_GL_ARG_NONNULL ((1)));
763 _GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy
, int,
764 (posix_spawn_file_actions_t
*__file_actions
));
766 _GL_CXXALIASWARN (posix_spawn_file_actions_destroy
);
767 #elif defined GNULIB_POSIXCHECK
768 # undef posix_spawn_file_actions_destroy
769 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
770 _GL_WARN_ON_USE (posix_spawn_file_actions_destroy
,
771 "posix_spawn_file_actions_destroy is unportable - "
772 "use gnulib module posix_spawn_file_actions_destroy for portability");
776 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
777 /* Add an action to FILE-ACTIONS which tells the implementation to call
778 'open' for the given file during the 'spawn' call. */
779 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
780 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
781 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
783 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen
, int,
784 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
786 const char *_Restrict_ __path
, int __oflag
, mode_t __mode
)
787 __THROW
_GL_ARG_NONNULL ((1, 3)));
788 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen
, int,
789 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
791 const char *_Restrict_ __path
, int __oflag
, mode_t __mode
));
793 # if !@HAVE_POSIX_SPAWN@
794 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen
, int,
795 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
797 const char *_Restrict_ __path
, int __oflag
, mode_t __mode
)
798 __THROW
_GL_ARG_NONNULL ((1, 3)));
800 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen
, int,
801 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
803 const char *_Restrict_ __path
, int __oflag
, mode_t __mode
));
805 _GL_CXXALIASWARN (posix_spawn_file_actions_addopen
);
806 #elif defined GNULIB_POSIXCHECK
807 # undef posix_spawn_file_actions_addopen
808 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
809 _GL_WARN_ON_USE (posix_spawn_file_actions_addopen
,
810 "posix_spawn_file_actions_addopen is unportable - "
811 "use gnulib module posix_spawn_file_actions_addopen for portability");
815 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
816 /* Add an action to FILE-ACTIONS which tells the implementation to call
817 'close' for the given file descriptor during the 'spawn' call. */
818 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
819 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
820 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
822 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose
, int,
823 (posix_spawn_file_actions_t
*__file_actions
, int __fd
)
824 __THROW
_GL_ARG_NONNULL ((1)));
825 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose
, int,
826 (posix_spawn_file_actions_t
*__file_actions
, int __fd
));
828 # if !@HAVE_POSIX_SPAWN@
829 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose
, int,
830 (posix_spawn_file_actions_t
*__file_actions
, int __fd
)
831 __THROW
_GL_ARG_NONNULL ((1)));
833 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose
, int,
834 (posix_spawn_file_actions_t
*__file_actions
, int __fd
));
836 _GL_CXXALIASWARN (posix_spawn_file_actions_addclose
);
837 #elif defined GNULIB_POSIXCHECK
838 # undef posix_spawn_file_actions_addclose
839 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
840 _GL_WARN_ON_USE (posix_spawn_file_actions_addclose
,
841 "posix_spawn_file_actions_addclose is unportable - "
842 "use gnulib module posix_spawn_file_actions_addclose for portability");
846 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
847 /* Add an action to FILE-ACTIONS which tells the implementation to call
848 'dup2' for the given file descriptors during the 'spawn' call. */
849 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
850 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
851 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
853 _GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2
, int,
854 (posix_spawn_file_actions_t
*__file_actions
,
855 int __fd
, int __newfd
)
856 __THROW
_GL_ARG_NONNULL ((1)));
857 _GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2
, int,
858 (posix_spawn_file_actions_t
*__file_actions
,
859 int __fd
, int __newfd
));
861 # if !@HAVE_POSIX_SPAWN@
862 _GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2
, int,
863 (posix_spawn_file_actions_t
*__file_actions
,
864 int __fd
, int __newfd
)
865 __THROW
_GL_ARG_NONNULL ((1)));
867 _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2
, int,
868 (posix_spawn_file_actions_t
*__file_actions
,
869 int __fd
, int __newfd
));
871 _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2
);
872 #elif defined GNULIB_POSIXCHECK
873 # undef posix_spawn_file_actions_adddup2
874 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
875 _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2
,
876 "posix_spawn_file_actions_adddup2 is unportable - "
877 "use gnulib module posix_spawn_file_actions_adddup2 for portability");
881 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
882 /* Add an action to FILE-ACTIONS which tells the implementation to call
883 'chdir' to the given directory during the 'spawn' call. */
884 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
885 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
886 # define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir
888 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir
, int,
889 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
890 const char *_Restrict_ __path
)
891 __THROW
_GL_ARG_NONNULL ((1, 2)));
892 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir
, int,
893 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
894 const char *_Restrict_ __path
));
896 # if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
897 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir
, int,
898 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
899 const char *_Restrict_ __path
)
900 __THROW
_GL_ARG_NONNULL ((1, 2)));
902 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir
, int,
903 (posix_spawn_file_actions_t
*_Restrict_ __file_actions
,
904 const char *_Restrict_ __path
));
906 _GL_CXXALIASWARN (posix_spawn_file_actions_addchdir
);
907 #elif defined GNULIB_POSIXCHECK
908 # undef posix_spawn_file_actions_addchdir
909 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
910 _GL_WARN_ON_USE (posix_spawn_file_actions_addchdir
,
911 "posix_spawn_file_actions_addchdir is unportable - "
912 "use gnulib module posix_spawn_file_actions_addchdir for portability");
917 #endif /* _@GUARD_PREFIX@_SPAWN_H */
918 #endif /* _@GUARD_PREFIX@_SPAWN_H */