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. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <https://www.gnu.org/licenses/>. */ 17 18 #ifndef _@GUARD_PREFIX@_SPAWN_H 19 20 #if __GNUC__ >= 3 21 @PRAGMA_SYSTEM_HEADER@ 22 #endif 23 @PRAGMA_COLUMNS@ 24 25 /* The include_next requires a split double-inclusion guard. */ 26 #if @HAVE_SPAWN_H@ 27 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@ 28 #endif 29 30 #ifndef _@GUARD_PREFIX@_SPAWN_H 31 #define _@GUARD_PREFIX@_SPAWN_H 32 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 39 40 #include <sys/types.h> 41 42 #ifndef __THROW 43 # define __THROW 44 #endif 45 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 || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) 54 # define _Restrict_ __restrict 55 # elif 199901L <= __STDC_VERSION__ || defined restrict 56 # define _Restrict_ restrict 57 # else 58 # define _Restrict_ 59 # endif 60 #endif 61 /* For [restrict], use glibc's __restrict_arr if available. 62 Otherwise, GCC 3.1 (not in C++ mode) and C99 support [restrict]. */ 63 #ifndef _Restrict_arr_ 64 # ifdef __restrict_arr 65 # define _Restrict_arr_ __restrict_arr 66 # elif ((199901L <= __STDC_VERSION__ || 3 < __GNUC__ + (1 <= __GNUC_MINOR__)) \ 67 && !defined __GNUG__) 68 # define _Restrict_arr_ _Restrict_ 69 # else 70 # define _Restrict_arr_ 71 # endif 72 #endif 73 74 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ 75 76 /* The definition of _GL_ARG_NONNULL is copied here. */ 77 78 /* The definition of _GL_WARN_ON_USE is copied here. */ 79 80 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 84 #endif 85 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@ || !@HAVE_POSIX_SPAWN@ 86 # if !GNULIB_defined_posix_spawnattr_t 87 typedef struct 88 { 89 short int _flags; 90 pid_t _pgrp; 91 sigset_t _sd; 92 sigset_t _ss; 93 struct sched_param _sp; 94 int _policy; 95 int __pad[16]; 96 } posix_spawnattr_t; 97 # define GNULIB_defined_posix_spawnattr_t 1 98 # endif 99 #endif 100 101 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 106 #endif 107 #if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ || !@HAVE_POSIX_SPAWN@ 108 # if !GNULIB_defined_posix_spawn_file_actions_t 109 typedef struct 110 { 111 int _allocated; 112 int _used; 113 struct __spawn_action *_actions; 114 int __pad[16]; 115 } posix_spawn_file_actions_t; 116 # define GNULIB_defined_posix_spawn_file_actions_t 1 117 # endif 118 #endif 119 120 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 126 # endif 127 # ifndef POSIX_SPAWN_SETSCHEDULER 128 # define POSIX_SPAWN_SETSCHEDULER 0 129 # endif 130 #else 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 135 # else 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 142 # endif 143 #endif 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)) \ 155 + 1) 156 #endif 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) 163 == 0) 164 ? 1 : -1]; 165 # define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1 166 #endif 167 168 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. 172 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 178 # endif 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_])); 194 # else 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))); 204 # endif 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_])); 212 # endif 213 _GL_CXXALIASWARN (posix_spawn); 214 #elif defined GNULIB_POSIXCHECK 215 # undef posix_spawn 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"); 219 # endif 220 #endif 221 222 #if @GNULIB_POSIX_SPAWNP@ 223 /* Similar to 'posix_spawn' but search for FILE in the PATH. 224 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 230 # endif 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[])); 242 # else 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))); 250 # endif 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[])); 256 # endif 257 _GL_CXXALIASWARN (posix_spawnp); 258 #elif defined GNULIB_POSIXCHECK 259 # undef posix_spawnp 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"); 263 # endif 264 #endif 265 266 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 272 # endif 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)); 276 # else 277 # if !@HAVE_POSIX_SPAWN@ 278 _GL_FUNCDECL_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr) 279 __THROW _GL_ARG_NONNULL ((1))); 280 # endif 281 _GL_CXXALIAS_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)); 282 # endif 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"); 289 # endif 290 #endif 291 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 297 # endif 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)); 301 # else 302 # if !@HAVE_POSIX_SPAWN@ 303 _GL_FUNCDECL_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr) 304 __THROW _GL_ARG_NONNULL ((1))); 305 # endif 306 _GL_CXXALIAS_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)); 307 # endif 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"); 315 # endif 316 #endif 317 318 #if @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@ 319 /* Store signal mask for signals with default handling from ATTR in 320 SIGDEFAULT. */ 321 # if @REPLACE_POSIX_SPAWN@ 322 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 323 # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault 324 # endif 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)); 332 # else 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))); 338 # endif 339 _GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault, int, 340 (const posix_spawnattr_t *_Restrict_ __attr, 341 sigset_t *_Restrict_ __sigdefault)); 342 # endif 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"); 350 # endif 351 #endif 352 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 358 # endif 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)); 366 # else 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))); 372 # endif 373 _GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault, int, 374 (posix_spawnattr_t *_Restrict_ __attr, 375 const sigset_t *_Restrict_ __sigdefault)); 376 # endif 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"); 384 # endif 385 #endif 386 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 392 # endif 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)); 400 # else 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))); 406 # endif 407 _GL_CXXALIAS_SYS (posix_spawnattr_getsigmask, int, 408 (const posix_spawnattr_t *_Restrict_ __attr, 409 sigset_t *_Restrict_ __sigmask)); 410 # endif 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"); 418 # endif 419 #endif 420 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 426 # endif 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)); 434 # else 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))); 440 # endif 441 _GL_CXXALIAS_SYS (posix_spawnattr_setsigmask, int, 442 (posix_spawnattr_t *_Restrict_ __attr, 443 const sigset_t *_Restrict_ __sigmask)); 444 # endif 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"); 452 # endif 453 #endif 454 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 460 # endif 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)); 468 # else 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))); 474 # endif 475 _GL_CXXALIAS_SYS (posix_spawnattr_getflags, int, 476 (const posix_spawnattr_t *_Restrict_ __attr, 477 short int *_Restrict_ __flags)); 478 # endif 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"); 486 # endif 487 #endif 488 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 494 # endif 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)); 500 # else 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))); 505 # endif 506 _GL_CXXALIAS_SYS (posix_spawnattr_setflags, int, 507 (posix_spawnattr_t *__attr, short int __flags)); 508 # endif 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"); 516 # endif 517 #endif 518 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 524 # endif 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)); 532 # else 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))); 538 # endif 539 _GL_CXXALIAS_SYS (posix_spawnattr_getpgroup, int, 540 (const posix_spawnattr_t *_Restrict_ __attr, 541 pid_t *_Restrict_ __pgroup)); 542 # endif 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"); 550 # endif 551 #endif 552 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 558 # endif 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)); 564 # else 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))); 569 # endif 570 _GL_CXXALIAS_SYS (posix_spawnattr_setpgroup, int, 571 (posix_spawnattr_t *__attr, pid_t __pgroup)); 572 # endif 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"); 580 # endif 581 #endif 582 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 588 # endif 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)); 596 # else 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))); 602 # endif 603 _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int, 604 (const posix_spawnattr_t *_Restrict_ __attr, 605 int *_Restrict_ __schedpolicy)); 606 # endif 607 # if __GLIBC__ >= 2 608 _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy); 609 # endif 610 #elif defined GNULIB_POSIXCHECK 611 # undef posix_spawnattr_getschedpolicy 612 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY 613 _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy, 614 "posix_spawnattr_getschedpolicy is unportable - " 615 "use gnulib module posix_spawnattr_getschedpolicy for portability"); 616 # endif 617 #endif 618 619 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@ 620 /* Store scheduling policy in the attribute structure. */ 621 # if @REPLACE_POSIX_SPAWN@ 622 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 623 # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy 624 # endif 625 _GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy, int, 626 (posix_spawnattr_t *__attr, int __schedpolicy) 627 __THROW _GL_ARG_NONNULL ((1))); 628 _GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy, int, 629 (posix_spawnattr_t *__attr, int __schedpolicy)); 630 # else 631 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDULER == 0 632 _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int, 633 (posix_spawnattr_t *__attr, int __schedpolicy) 634 __THROW _GL_ARG_NONNULL ((1))); 635 # endif 636 _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int, 637 (posix_spawnattr_t *__attr, int __schedpolicy)); 638 # endif 639 # if __GLIBC__ >= 2 640 _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy); 641 # endif 642 #elif defined GNULIB_POSIXCHECK 643 # undef posix_spawnattr_setschedpolicy 644 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY 645 _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy, 646 "posix_spawnattr_setschedpolicy is unportable - " 647 "use gnulib module posix_spawnattr_setschedpolicy for portability"); 648 # endif 649 #endif 650 651 #if @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@ 652 /* Get scheduling parameters from the attribute structure. */ 653 # if @REPLACE_POSIX_SPAWN@ 654 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 655 # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam 656 # endif 657 _GL_FUNCDECL_RPL (posix_spawnattr_getschedparam, int, 658 (const posix_spawnattr_t *_Restrict_ __attr, 659 struct sched_param *_Restrict_ __schedparam) 660 __THROW _GL_ARG_NONNULL ((1, 2))); 661 _GL_CXXALIAS_RPL (posix_spawnattr_getschedparam, int, 662 (const posix_spawnattr_t *_Restrict_ __attr, 663 struct sched_param *_Restrict_ __schedparam)); 664 # else 665 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0 666 _GL_FUNCDECL_SYS (posix_spawnattr_getschedparam, int, 667 (const posix_spawnattr_t *_Restrict_ __attr, 668 struct sched_param *_Restrict_ __schedparam) 669 __THROW _GL_ARG_NONNULL ((1, 2))); 670 # endif 671 _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int, 672 (const posix_spawnattr_t *_Restrict_ __attr, 673 struct sched_param *_Restrict_ __schedparam)); 674 # endif 675 # if __GLIBC__ >= 2 676 _GL_CXXALIASWARN (posix_spawnattr_getschedparam); 677 # endif 678 #elif defined GNULIB_POSIXCHECK 679 # undef posix_spawnattr_getschedparam 680 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM 681 _GL_WARN_ON_USE (posix_spawnattr_getschedparam, 682 "posix_spawnattr_getschedparam is unportable - " 683 "use gnulib module posix_spawnattr_getschedparam for portability"); 684 # endif 685 #endif 686 687 #if @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@ 688 /* Store scheduling parameters in the attribute structure. */ 689 # if @REPLACE_POSIX_SPAWN@ 690 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 691 # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam 692 # endif 693 _GL_FUNCDECL_RPL (posix_spawnattr_setschedparam, int, 694 (posix_spawnattr_t *_Restrict_ __attr, 695 const struct sched_param *_Restrict_ __schedparam) 696 __THROW _GL_ARG_NONNULL ((1, 2))); 697 _GL_CXXALIAS_RPL (posix_spawnattr_setschedparam, int, 698 (posix_spawnattr_t *_Restrict_ __attr, 699 const struct sched_param *_Restrict_ __schedparam)); 700 # else 701 # if !@HAVE_POSIX_SPAWN@ || POSIX_SPAWN_SETSCHEDPARAM == 0 702 _GL_FUNCDECL_SYS (posix_spawnattr_setschedparam, int, 703 (posix_spawnattr_t *_Restrict_ __attr, 704 const struct sched_param *_Restrict_ __schedparam) 705 __THROW _GL_ARG_NONNULL ((1, 2))); 706 # endif 707 _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int, 708 (posix_spawnattr_t *_Restrict_ __attr, 709 const struct sched_param *_Restrict_ __schedparam)); 710 # endif 711 # if __GLIBC__ >= 2 712 _GL_CXXALIASWARN (posix_spawnattr_setschedparam); 713 # endif 714 #elif defined GNULIB_POSIXCHECK 715 # undef posix_spawnattr_setschedparam 716 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM 717 _GL_WARN_ON_USE (posix_spawnattr_setschedparam, 718 "posix_spawnattr_setschedparam is unportable - " 719 "use gnulib module posix_spawnattr_setschedparam for portability"); 720 # endif 721 #endif 722 723 724 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@ 725 /* Initialize data structure for file attribute for 'spawn' call. */ 726 # if @REPLACE_POSIX_SPAWN@ 727 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 728 # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init 729 # endif 730 _GL_FUNCDECL_RPL (posix_spawn_file_actions_init, int, 731 (posix_spawn_file_actions_t *__file_actions) 732 __THROW _GL_ARG_NONNULL ((1))); 733 _GL_CXXALIAS_RPL (posix_spawn_file_actions_init, int, 734 (posix_spawn_file_actions_t *__file_actions)); 735 # else 736 # if !@HAVE_POSIX_SPAWN@ 737 _GL_FUNCDECL_SYS (posix_spawn_file_actions_init, int, 738 (posix_spawn_file_actions_t *__file_actions) 739 __THROW _GL_ARG_NONNULL ((1))); 740 # endif 741 _GL_CXXALIAS_SYS (posix_spawn_file_actions_init, int, 742 (posix_spawn_file_actions_t *__file_actions)); 743 # endif 744 _GL_CXXALIASWARN (posix_spawn_file_actions_init); 745 #elif defined GNULIB_POSIXCHECK 746 # undef posix_spawn_file_actions_init 747 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT 748 _GL_WARN_ON_USE (posix_spawn_file_actions_init, 749 "posix_spawn_file_actions_init is unportable - " 750 "use gnulib module posix_spawn_file_actions_init for portability"); 751 # endif 752 #endif 753 754 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@ 755 /* Free resources associated with FILE-ACTIONS. */ 756 # if @REPLACE_POSIX_SPAWN@ 757 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 758 # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy 759 # endif 760 _GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy, int, 761 (posix_spawn_file_actions_t *__file_actions) 762 __THROW _GL_ARG_NONNULL ((1))); 763 _GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy, int, 764 (posix_spawn_file_actions_t *__file_actions)); 765 # else 766 # if !@HAVE_POSIX_SPAWN@ 767 _GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy, int, 768 (posix_spawn_file_actions_t *__file_actions) 769 __THROW _GL_ARG_NONNULL ((1))); 770 # endif 771 _GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy, int, 772 (posix_spawn_file_actions_t *__file_actions)); 773 # endif 774 _GL_CXXALIASWARN (posix_spawn_file_actions_destroy); 775 #elif defined GNULIB_POSIXCHECK 776 # undef posix_spawn_file_actions_destroy 777 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY 778 _GL_WARN_ON_USE (posix_spawn_file_actions_destroy, 779 "posix_spawn_file_actions_destroy is unportable - " 780 "use gnulib module posix_spawn_file_actions_destroy for portability"); 781 # endif 782 #endif 783 784 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ 785 /* Add an action to FILE-ACTIONS which tells the implementation to call 786 'open' for the given file during the 'spawn' call. */ 787 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@ 788 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 789 # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen 790 # endif 791 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen, int, 792 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 793 int __fd, 794 const char *_Restrict_ __path, int __oflag, mode_t __mode) 795 __THROW _GL_ARG_NONNULL ((1, 3))); 796 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen, int, 797 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 798 int __fd, 799 const char *_Restrict_ __path, int __oflag, mode_t __mode)); 800 # else 801 # if !@HAVE_POSIX_SPAWN@ 802 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen, int, 803 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 804 int __fd, 805 const char *_Restrict_ __path, int __oflag, mode_t __mode) 806 __THROW _GL_ARG_NONNULL ((1, 3))); 807 # endif 808 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int, 809 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 810 int __fd, 811 const char *_Restrict_ __path, int __oflag, mode_t __mode)); 812 # endif 813 # if __GLIBC__ >= 2 814 _GL_CXXALIASWARN (posix_spawn_file_actions_addopen); 815 # endif 816 #elif defined GNULIB_POSIXCHECK 817 # undef posix_spawn_file_actions_addopen 818 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 819 _GL_WARN_ON_USE (posix_spawn_file_actions_addopen, 820 "posix_spawn_file_actions_addopen is unportable - " 821 "use gnulib module posix_spawn_file_actions_addopen for portability"); 822 # endif 823 #endif 824 825 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ 826 /* Add an action to FILE-ACTIONS which tells the implementation to call 827 'close' for the given file descriptor during the 'spawn' call. */ 828 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@ 829 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 830 # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose 831 # endif 832 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose, int, 833 (posix_spawn_file_actions_t *__file_actions, int __fd) 834 __THROW _GL_ARG_NONNULL ((1))); 835 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose, int, 836 (posix_spawn_file_actions_t *__file_actions, int __fd)); 837 # else 838 # if !@HAVE_POSIX_SPAWN@ 839 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int, 840 (posix_spawn_file_actions_t *__file_actions, int __fd) 841 __THROW _GL_ARG_NONNULL ((1))); 842 # endif 843 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int, 844 (posix_spawn_file_actions_t *__file_actions, int __fd)); 845 # endif 846 # if __GLIBC__ >= 2 847 _GL_CXXALIASWARN (posix_spawn_file_actions_addclose); 848 # endif 849 #elif defined GNULIB_POSIXCHECK 850 # undef posix_spawn_file_actions_addclose 851 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 852 _GL_WARN_ON_USE (posix_spawn_file_actions_addclose, 853 "posix_spawn_file_actions_addclose is unportable - " 854 "use gnulib module posix_spawn_file_actions_addclose for portability"); 855 # endif 856 #endif 857 858 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ 859 /* Add an action to FILE-ACTIONS which tells the implementation to call 860 'dup2' for the given file descriptors during the 'spawn' call. */ 861 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@ 862 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 863 # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2 864 # endif 865 _GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2, int, 866 (posix_spawn_file_actions_t *__file_actions, 867 int __fd, int __newfd) 868 __THROW _GL_ARG_NONNULL ((1))); 869 _GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2, int, 870 (posix_spawn_file_actions_t *__file_actions, 871 int __fd, int __newfd)); 872 # else 873 # if !@HAVE_POSIX_SPAWN@ 874 _GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2, int, 875 (posix_spawn_file_actions_t *__file_actions, 876 int __fd, int __newfd) 877 __THROW _GL_ARG_NONNULL ((1))); 878 # endif 879 _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int, 880 (posix_spawn_file_actions_t *__file_actions, 881 int __fd, int __newfd)); 882 # endif 883 # if __GLIBC__ >= 2 884 _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2); 885 # endif 886 #elif defined GNULIB_POSIXCHECK 887 # undef posix_spawn_file_actions_adddup2 888 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 889 _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2, 890 "posix_spawn_file_actions_adddup2 is unportable - " 891 "use gnulib module posix_spawn_file_actions_adddup2 for portability"); 892 # endif 893 #endif 894 895 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@ 896 /* Add an action to FILE-ACTIONS which tells the implementation to call 897 'chdir' to the given directory during the 'spawn' call. */ 898 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@ 899 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 900 # define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir 901 # endif 902 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir, int, 903 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 904 const char *_Restrict_ __path) 905 __THROW _GL_ARG_NONNULL ((1, 2))); 906 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir, int, 907 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 908 const char *_Restrict_ __path)); 909 # else 910 # if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@ 911 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir, int, 912 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 913 const char *_Restrict_ __path) 914 __THROW _GL_ARG_NONNULL ((1, 2))); 915 # endif 916 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir, int, 917 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 918 const char *_Restrict_ __path)); 919 # endif 920 _GL_CXXALIASWARN (posix_spawn_file_actions_addchdir); 921 #elif defined GNULIB_POSIXCHECK 922 # undef posix_spawn_file_actions_addchdir 923 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR 924 _GL_WARN_ON_USE (posix_spawn_file_actions_addchdir, 925 "posix_spawn_file_actions_addchdir is unportable - " 926 "use gnulib module posix_spawn_file_actions_addchdir for portability"); 927 # endif 928 #endif 929 930 #if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@ 931 /* Add an action to FILE-ACTIONS which tells the implementation to call 932 'fchdir' to the given directory during the 'spawn' call. */ 933 # if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@ 934 # if !(defined __cplusplus && defined GNULIB_NAMESPACE) 935 # define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir 936 # endif 937 _GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int, 938 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 939 int __fd) 940 __THROW _GL_ARG_NONNULL ((1))); 941 _GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int, 942 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 943 int __fd)); 944 # else 945 # if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@ 946 _GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int, 947 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 948 int __fd) 949 __THROW _GL_ARG_NONNULL ((1))); 950 # endif 951 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int, 952 (posix_spawn_file_actions_t *_Restrict_ __file_actions, 953 int __fd)); 954 # endif 955 _GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir); 956 #elif defined GNULIB_POSIXCHECK 957 # undef posix_spawn_file_actions_addfchdir 958 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR 959 _GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir, 960 "posix_spawn_file_actions_addfchdir is unportable - " 961 "use gnulib module posix_spawn_file_actions_addfchdir for portability"); 962 # endif 963 #endif 964 965 966 #endif /* _@GUARD_PREFIX@_SPAWN_H */ 967 #endif /* _@GUARD_PREFIX@_SPAWN_H */ 968