spawn.in.h 40 KB

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