spawn.h 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500
  1. /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
  2. /* Definitions for POSIX spawn interface.
  3. Copyright (C) 2000, 2003-2004, 2008-2022 Free Software Foundation, Inc.
  4. This file is part of the GNU C Library.
  5. This file is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU Lesser General Public License as
  7. published by the Free Software Foundation; either version 2.1 of the
  8. License, or (at your option) any later version.
  9. This file is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public License
  14. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  15. #if __GNUC__ >= 3
  16. #pragma GCC system_header
  17. #endif
  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 <spawn.h>
  24. #else
  25. #ifndef _GL_SPAWN_H
  26. /* Normal invocation convention. */
  27. /* The include_next requires a split double-inclusion guard. */
  28. #if 1
  29. # define _GL_ALREADY_INCLUDING_SPAWN_H
  30. # include_next <spawn.h>
  31. # define _GL_ALREADY_INCLUDING_SPAWN_H
  32. #endif
  33. #ifndef _GL_SPAWN_H
  34. #define _GL_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. /* C++ compatible function declaration macros.
  81. Copyright (C) 2010-2022 Free Software Foundation, Inc.
  82. This program is free software: you can redistribute it and/or modify it
  83. under the terms of the GNU Lesser General Public License as published
  84. by the Free Software Foundation; either version 2 of the License, or
  85. (at your option) any later version.
  86. This program is distributed in the hope that it will be useful,
  87. but WITHOUT ANY WARRANTY; without even the implied warranty of
  88. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  89. Lesser General Public License for more details.
  90. You should have received a copy of the GNU Lesser General Public License
  91. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  92. #ifndef _GL_CXXDEFS_H
  93. #define _GL_CXXDEFS_H
  94. /* Begin/end the GNULIB_NAMESPACE namespace. */
  95. #if defined __cplusplus && defined GNULIB_NAMESPACE
  96. # define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
  97. # define _GL_END_NAMESPACE }
  98. #else
  99. # define _GL_BEGIN_NAMESPACE
  100. # define _GL_END_NAMESPACE
  101. #endif
  102. /* The three most frequent use cases of these macros are:
  103. * For providing a substitute for a function that is missing on some
  104. platforms, but is declared and works fine on the platforms on which
  105. it exists:
  106. #if @GNULIB_FOO@
  107. # if !@HAVE_FOO@
  108. _GL_FUNCDECL_SYS (foo, ...);
  109. # endif
  110. _GL_CXXALIAS_SYS (foo, ...);
  111. _GL_CXXALIASWARN (foo);
  112. #elif defined GNULIB_POSIXCHECK
  113. ...
  114. #endif
  115. * For providing a replacement for a function that exists on all platforms,
  116. but is broken/insufficient and needs to be replaced on some platforms:
  117. #if @GNULIB_FOO@
  118. # if @REPLACE_FOO@
  119. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  120. # undef foo
  121. # define foo rpl_foo
  122. # endif
  123. _GL_FUNCDECL_RPL (foo, ...);
  124. _GL_CXXALIAS_RPL (foo, ...);
  125. # else
  126. _GL_CXXALIAS_SYS (foo, ...);
  127. # endif
  128. _GL_CXXALIASWARN (foo);
  129. #elif defined GNULIB_POSIXCHECK
  130. ...
  131. #endif
  132. * For providing a replacement for a function that exists on some platforms
  133. but is broken/insufficient and needs to be replaced on some of them and
  134. is additionally either missing or undeclared on some other platforms:
  135. #if @GNULIB_FOO@
  136. # if @REPLACE_FOO@
  137. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  138. # undef foo
  139. # define foo rpl_foo
  140. # endif
  141. _GL_FUNCDECL_RPL (foo, ...);
  142. _GL_CXXALIAS_RPL (foo, ...);
  143. # else
  144. # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
  145. _GL_FUNCDECL_SYS (foo, ...);
  146. # endif
  147. _GL_CXXALIAS_SYS (foo, ...);
  148. # endif
  149. _GL_CXXALIASWARN (foo);
  150. #elif defined GNULIB_POSIXCHECK
  151. ...
  152. #endif
  153. */
  154. /* _GL_EXTERN_C declaration;
  155. performs the declaration with C linkage. */
  156. #if defined __cplusplus
  157. # define _GL_EXTERN_C extern "C"
  158. #else
  159. # define _GL_EXTERN_C extern
  160. #endif
  161. /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
  162. declares a replacement function, named rpl_func, with the given prototype,
  163. consisting of return type, parameters, and attributes.
  164. Example:
  165. _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
  166. _GL_ARG_NONNULL ((1)));
  167. */
  168. #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
  169. _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
  170. #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
  171. _GL_EXTERN_C rettype rpl_func parameters_and_attributes
  172. /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
  173. declares the system function, named func, with the given prototype,
  174. consisting of return type, parameters, and attributes.
  175. Example:
  176. _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
  177. _GL_ARG_NONNULL ((1)));
  178. */
  179. #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
  180. _GL_EXTERN_C rettype func parameters_and_attributes
  181. /* _GL_CXXALIAS_RPL (func, rettype, parameters);
  182. declares a C++ alias called GNULIB_NAMESPACE::func
  183. that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
  184. Example:
  185. _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
  186. Wrapping rpl_func in an object with an inline conversion operator
  187. avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
  188. actually used in the program. */
  189. #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
  190. _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
  191. #if defined __cplusplus && defined GNULIB_NAMESPACE
  192. # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
  193. namespace GNULIB_NAMESPACE \
  194. { \
  195. static const struct _gl_ ## func ## _wrapper \
  196. { \
  197. typedef rettype (*type) parameters; \
  198. \
  199. inline operator type () const \
  200. { \
  201. return ::rpl_func; \
  202. } \
  203. } func = {}; \
  204. } \
  205. _GL_EXTERN_C int _gl_cxxalias_dummy
  206. #else
  207. # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
  208. _GL_EXTERN_C int _gl_cxxalias_dummy
  209. #endif
  210. /* _GL_CXXALIAS_MDA (func, rettype, parameters);
  211. is to be used when func is a Microsoft deprecated alias, on native Windows.
  212. It declares a C++ alias called GNULIB_NAMESPACE::func
  213. that redirects to _func, if GNULIB_NAMESPACE is defined.
  214. Example:
  215. _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
  216. */
  217. #define _GL_CXXALIAS_MDA(func,rettype,parameters) \
  218. _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
  219. /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
  220. is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
  221. except that the C function rpl_func may have a slightly different
  222. declaration. A cast is used to silence the "invalid conversion" error
  223. that would otherwise occur. */
  224. #if defined __cplusplus && defined GNULIB_NAMESPACE
  225. # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
  226. namespace GNULIB_NAMESPACE \
  227. { \
  228. static const struct _gl_ ## func ## _wrapper \
  229. { \
  230. typedef rettype (*type) parameters; \
  231. \
  232. inline operator type () const \
  233. { \
  234. return reinterpret_cast<type>(::rpl_func); \
  235. } \
  236. } func = {}; \
  237. } \
  238. _GL_EXTERN_C int _gl_cxxalias_dummy
  239. #else
  240. # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
  241. _GL_EXTERN_C int _gl_cxxalias_dummy
  242. #endif
  243. /* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
  244. is like _GL_CXXALIAS_MDA (func, rettype, parameters);
  245. except that the C function func may have a slightly different declaration.
  246. A cast is used to silence the "invalid conversion" error that would
  247. otherwise occur. */
  248. #define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
  249. _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
  250. /* _GL_CXXALIAS_SYS (func, rettype, parameters);
  251. declares a C++ alias called GNULIB_NAMESPACE::func
  252. that redirects to the system provided function func, if GNULIB_NAMESPACE
  253. is defined.
  254. Example:
  255. _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
  256. Wrapping func in an object with an inline conversion operator
  257. avoids a reference to func unless GNULIB_NAMESPACE::func is
  258. actually used in the program. */
  259. #if defined __cplusplus && defined GNULIB_NAMESPACE
  260. # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
  261. namespace GNULIB_NAMESPACE \
  262. { \
  263. static const struct _gl_ ## func ## _wrapper \
  264. { \
  265. typedef rettype (*type) parameters; \
  266. \
  267. inline operator type () const \
  268. { \
  269. return ::func; \
  270. } \
  271. } func = {}; \
  272. } \
  273. _GL_EXTERN_C int _gl_cxxalias_dummy
  274. #else
  275. # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
  276. _GL_EXTERN_C int _gl_cxxalias_dummy
  277. #endif
  278. /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
  279. is like _GL_CXXALIAS_SYS (func, rettype, parameters);
  280. except that the C function func may have a slightly different declaration.
  281. A cast is used to silence the "invalid conversion" error that would
  282. otherwise occur. */
  283. #if defined __cplusplus && defined GNULIB_NAMESPACE
  284. # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
  285. namespace GNULIB_NAMESPACE \
  286. { \
  287. static const struct _gl_ ## func ## _wrapper \
  288. { \
  289. typedef rettype (*type) parameters; \
  290. \
  291. inline operator type () const \
  292. { \
  293. return reinterpret_cast<type>(::func); \
  294. } \
  295. } func = {}; \
  296. } \
  297. _GL_EXTERN_C int _gl_cxxalias_dummy
  298. #else
  299. # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
  300. _GL_EXTERN_C int _gl_cxxalias_dummy
  301. #endif
  302. /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
  303. is like _GL_CXXALIAS_SYS (func, rettype, parameters);
  304. except that the C function is picked among a set of overloaded functions,
  305. namely the one with rettype2 and parameters2. Two consecutive casts
  306. are used to silence the "cannot find a match" and "invalid conversion"
  307. errors that would otherwise occur. */
  308. #if defined __cplusplus && defined GNULIB_NAMESPACE
  309. /* The outer cast must be a reinterpret_cast.
  310. The inner cast: When the function is defined as a set of overloaded
  311. functions, it works as a static_cast<>, choosing the designated variant.
  312. When the function is defined as a single variant, it works as a
  313. reinterpret_cast<>. The parenthesized cast syntax works both ways. */
  314. # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
  315. namespace GNULIB_NAMESPACE \
  316. { \
  317. static const struct _gl_ ## func ## _wrapper \
  318. { \
  319. typedef rettype (*type) parameters; \
  320. \
  321. inline operator type () const \
  322. { \
  323. return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
  324. } \
  325. } func = {}; \
  326. } \
  327. _GL_EXTERN_C int _gl_cxxalias_dummy
  328. #else
  329. # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
  330. _GL_EXTERN_C int _gl_cxxalias_dummy
  331. #endif
  332. /* _GL_CXXALIASWARN (func);
  333. causes a warning to be emitted when ::func is used but not when
  334. GNULIB_NAMESPACE::func is used. func must be defined without overloaded
  335. variants. */
  336. #if defined __cplusplus && defined GNULIB_NAMESPACE
  337. # define _GL_CXXALIASWARN(func) \
  338. _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
  339. # define _GL_CXXALIASWARN_1(func,namespace) \
  340. _GL_CXXALIASWARN_2 (func, namespace)
  341. /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
  342. we enable the warning only when not optimizing. */
  343. # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
  344. # define _GL_CXXALIASWARN_2(func,namespace) \
  345. _GL_WARN_ON_USE (func, \
  346. "The symbol ::" #func " refers to the system function. " \
  347. "Use " #namespace "::" #func " instead.")
  348. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  349. # define _GL_CXXALIASWARN_2(func,namespace) \
  350. extern __typeof__ (func) func
  351. # else
  352. # define _GL_CXXALIASWARN_2(func,namespace) \
  353. _GL_EXTERN_C int _gl_cxxalias_dummy
  354. # endif
  355. #else
  356. # define _GL_CXXALIASWARN(func) \
  357. _GL_EXTERN_C int _gl_cxxalias_dummy
  358. #endif
  359. /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
  360. causes a warning to be emitted when the given overloaded variant of ::func
  361. is used but not when GNULIB_NAMESPACE::func is used. */
  362. #if defined __cplusplus && defined GNULIB_NAMESPACE
  363. # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
  364. _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
  365. GNULIB_NAMESPACE)
  366. # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
  367. _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
  368. /* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
  369. we enable the warning only when not optimizing. */
  370. # if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
  371. # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
  372. _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
  373. "The symbol ::" #func " refers to the system function. " \
  374. "Use " #namespace "::" #func " instead.")
  375. # else
  376. # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
  377. _GL_EXTERN_C int _gl_cxxalias_dummy
  378. # endif
  379. #else
  380. # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
  381. _GL_EXTERN_C int _gl_cxxalias_dummy
  382. #endif
  383. #endif /* _GL_CXXDEFS_H */
  384. /* The definition of _GL_ARG_NONNULL is copied here. */
  385. /* A C macro for declaring that specific arguments must not be NULL.
  386. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  387. This program is free software: you can redistribute it and/or modify it
  388. under the terms of the GNU Lesser General Public License as published
  389. by the Free Software Foundation; either version 2 of the License, or
  390. (at your option) any later version.
  391. This program is distributed in the hope that it will be useful,
  392. but WITHOUT ANY WARRANTY; without even the implied warranty of
  393. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  394. Lesser General Public License for more details.
  395. You should have received a copy of the GNU Lesser General Public License
  396. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  397. /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
  398. that the values passed as arguments n, ..., m must be non-NULL pointers.
  399. n = 1 stands for the first argument, n = 2 for the second argument etc. */
  400. #ifndef _GL_ARG_NONNULL
  401. # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
  402. # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
  403. # else
  404. # define _GL_ARG_NONNULL(params)
  405. # endif
  406. #endif
  407. /* The definition of _GL_WARN_ON_USE is copied here. */
  408. /* A C macro for emitting warnings if a function is used.
  409. Copyright (C) 2010-2022 Free Software Foundation, Inc.
  410. This program is free software: you can redistribute it and/or modify it
  411. under the terms of the GNU Lesser General Public License as published
  412. by the Free Software Foundation; either version 2 of the License, or
  413. (at your option) any later version.
  414. This program is distributed in the hope that it will be useful,
  415. but WITHOUT ANY WARRANTY; without even the implied warranty of
  416. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  417. Lesser General Public License for more details.
  418. You should have received a copy of the GNU Lesser General Public License
  419. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  420. /* _GL_WARN_ON_USE (function, "literal string") issues a declaration
  421. for FUNCTION which will then trigger a compiler warning containing
  422. the text of "literal string" anywhere that function is called, if
  423. supported by the compiler. If the compiler does not support this
  424. feature, the macro expands to an unused extern declaration.
  425. _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
  426. attribute used in _GL_WARN_ON_USE. If the compiler does not support
  427. this feature, it expands to empty.
  428. These macros are useful for marking a function as a potential
  429. portability trap, with the intent that "literal string" include
  430. instructions on the replacement function that should be used
  431. instead.
  432. _GL_WARN_ON_USE is for functions with 'extern' linkage.
  433. _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
  434. linkage.
  435. However, one of the reasons that a function is a portability trap is
  436. if it has the wrong signature. Declaring FUNCTION with a different
  437. signature in C is a compilation error, so this macro must use the
  438. same type as any existing declaration so that programs that avoid
  439. the problematic FUNCTION do not fail to compile merely because they
  440. included a header that poisoned the function. But this implies that
  441. _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
  442. have a declaration. Use of this macro implies that there must not
  443. be any other macro hiding the declaration of FUNCTION; but
  444. undefining FUNCTION first is part of the poisoning process anyway
  445. (although for symbols that are provided only via a macro, the result
  446. is a compilation error rather than a warning containing
  447. "literal string"). Also note that in C++, it is only safe to use if
  448. FUNCTION has no overloads.
  449. For an example, it is possible to poison 'getline' by:
  450. - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
  451. [getline]) in configure.ac, which potentially defines
  452. HAVE_RAW_DECL_GETLINE
  453. - adding this code to a header that wraps the system <stdio.h>:
  454. #undef getline
  455. #if HAVE_RAW_DECL_GETLINE
  456. _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
  457. "not universally present; use the gnulib module getline");
  458. #endif
  459. It is not possible to directly poison global variables. But it is
  460. possible to write a wrapper accessor function, and poison that
  461. (less common usage, like &environ, will cause a compilation error
  462. rather than issue the nice warning, but the end result of informing
  463. the developer about their portability problem is still achieved):
  464. #if HAVE_RAW_DECL_ENVIRON
  465. static char ***
  466. rpl_environ (void) { return &environ; }
  467. _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
  468. # undef environ
  469. # define environ (*rpl_environ ())
  470. #endif
  471. or better (avoiding contradictory use of 'static' and 'extern'):
  472. #if HAVE_RAW_DECL_ENVIRON
  473. static char ***
  474. _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
  475. rpl_environ (void) { return &environ; }
  476. # undef environ
  477. # define environ (*rpl_environ ())
  478. #endif
  479. */
  480. #ifndef _GL_WARN_ON_USE
  481. # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
  482. /* A compiler attribute is available in gcc versions 4.3.0 and later. */
  483. # define _GL_WARN_ON_USE(function, message) \
  484. _GL_WARN_EXTERN_C __typeof__ (function) function __attribute__ ((__warning__ (message)))
  485. # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
  486. __attribute__ ((__warning__ (message)))
  487. # elif __clang_major__ >= 4
  488. /* Another compiler attribute is available in clang. */
  489. # define _GL_WARN_ON_USE(function, message) \
  490. _GL_WARN_EXTERN_C __typeof__ (function) function \
  491. __attribute__ ((__diagnose_if__ (1, message, "warning")))
  492. # define _GL_WARN_ON_USE_ATTRIBUTE(message) \
  493. __attribute__ ((__diagnose_if__ (1, message, "warning")))
  494. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  495. /* Verify the existence of the function. */
  496. # define _GL_WARN_ON_USE(function, message) \
  497. _GL_WARN_EXTERN_C __typeof__ (function) function
  498. # define _GL_WARN_ON_USE_ATTRIBUTE(message)
  499. # else /* Unsupported. */
  500. # define _GL_WARN_ON_USE(function, message) \
  501. _GL_WARN_EXTERN_C int _gl_warn_on_use
  502. # define _GL_WARN_ON_USE_ATTRIBUTE(message)
  503. # endif
  504. #endif
  505. /* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
  506. is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
  507. function is declared with the given prototype, consisting of return type,
  508. parameters, and attributes.
  509. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
  510. not work in this case. */
  511. #ifndef _GL_WARN_ON_USE_CXX
  512. # if !defined __cplusplus
  513. # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
  514. _GL_WARN_ON_USE (function, msg)
  515. # else
  516. # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
  517. /* A compiler attribute is available in gcc versions 4.3.0 and later. */
  518. # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
  519. extern rettype_gcc function parameters_and_attributes \
  520. __attribute__ ((__warning__ (msg)))
  521. # elif __clang_major__ >= 4
  522. /* Another compiler attribute is available in clang. */
  523. # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
  524. extern rettype_clang function parameters_and_attributes \
  525. __attribute__ ((__diagnose_if__ (1, msg, "warning")))
  526. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  527. /* Verify the existence of the function. */
  528. # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
  529. extern rettype_gcc function parameters_and_attributes
  530. # else /* Unsupported. */
  531. # define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
  532. _GL_WARN_EXTERN_C int _gl_warn_on_use
  533. # endif
  534. # endif
  535. #endif
  536. /* _GL_WARN_EXTERN_C declaration;
  537. performs the declaration with C linkage. */
  538. #ifndef _GL_WARN_EXTERN_C
  539. # if defined __cplusplus
  540. # define _GL_WARN_EXTERN_C extern "C"
  541. # else
  542. # define _GL_WARN_EXTERN_C extern
  543. # endif
  544. #endif
  545. /* Data structure to contain attributes for thread creation. */
  546. #if 0 || (1 && !1)
  547. # define posix_spawnattr_t rpl_posix_spawnattr_t
  548. #endif
  549. #if 0 || !1 || !1
  550. # if !GNULIB_defined_posix_spawnattr_t
  551. typedef struct
  552. {
  553. short int _flags;
  554. pid_t _pgrp;
  555. sigset_t _sd;
  556. sigset_t _ss;
  557. struct sched_param _sp;
  558. int _policy;
  559. int __pad[16];
  560. } posix_spawnattr_t;
  561. # define GNULIB_defined_posix_spawnattr_t 1
  562. # endif
  563. #endif
  564. /* Data structure to contain information about the actions to be
  565. performed in the new process with respect to file descriptors. */
  566. #if 0 || (1 && !1)
  567. # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
  568. #endif
  569. #if 0 || !1 || !1
  570. # if !GNULIB_defined_posix_spawn_file_actions_t
  571. typedef struct
  572. {
  573. int _allocated;
  574. int _used;
  575. struct __spawn_action *_actions;
  576. int __pad[16];
  577. } posix_spawn_file_actions_t;
  578. # define GNULIB_defined_posix_spawn_file_actions_t 1
  579. # endif
  580. #endif
  581. /* Flags to be set in the 'posix_spawnattr_t'. */
  582. #if 1
  583. /* Use the values from the system, but provide the missing ones. */
  584. # ifndef POSIX_SPAWN_SETSCHEDPARAM
  585. # define POSIX_SPAWN_SETSCHEDPARAM 0
  586. # endif
  587. # ifndef POSIX_SPAWN_SETSCHEDULER
  588. # define POSIX_SPAWN_SETSCHEDULER 0
  589. # endif
  590. #else
  591. # if 0
  592. /* Use the values from the system, for better compatibility. */
  593. /* But this implementation does not support AIX extensions. */
  594. # undef POSIX_SPAWN_FORK_HANDLERS
  595. # else
  596. # define POSIX_SPAWN_RESETIDS 0x01
  597. # define POSIX_SPAWN_SETPGROUP 0x02
  598. # define POSIX_SPAWN_SETSIGDEF 0x04
  599. # define POSIX_SPAWN_SETSIGMASK 0x08
  600. # define POSIX_SPAWN_SETSCHEDPARAM 0x10
  601. # define POSIX_SPAWN_SETSCHEDULER 0x20
  602. # endif
  603. #endif
  604. /* A GNU extension. Use the next free bit position. */
  605. #ifndef POSIX_SPAWN_USEVFORK
  606. # define POSIX_SPAWN_USEVFORK \
  607. ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
  608. | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
  609. | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
  610. | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
  611. | POSIX_SPAWN_SETSCHEDPARAM \
  612. | (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
  613. | POSIX_SPAWN_SETSCHEDULER \
  614. | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
  615. + 1)
  616. #endif
  617. #if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
  618. typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
  619. [(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
  620. | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
  621. | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
  622. & POSIX_SPAWN_USEVFORK)
  623. == 0)
  624. ? 1 : -1];
  625. # define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
  626. #endif
  627. #if 0
  628. /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
  629. Before running the process perform the actions described in FILE-ACTIONS.
  630. This function is a possible cancellation points and therefore not
  631. marked with __THROW. */
  632. # if 0
  633. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  634. # define posix_spawn rpl_posix_spawn
  635. # endif
  636. _GL_FUNCDECL_RPL (posix_spawn, int,
  637. (pid_t *_Restrict_ __pid,
  638. const char *_Restrict_ __path,
  639. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  640. const posix_spawnattr_t *_Restrict_ __attrp,
  641. char *const argv[_Restrict_arr_],
  642. char *const envp[_Restrict_arr_])
  643. _GL_ARG_NONNULL ((2, 5, 6)));
  644. _GL_CXXALIAS_RPL (posix_spawn, int,
  645. (pid_t *_Restrict_ __pid,
  646. const char *_Restrict_ __path,
  647. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  648. const posix_spawnattr_t *_Restrict_ __attrp,
  649. char *const argv[_Restrict_arr_],
  650. char *const envp[_Restrict_arr_]));
  651. # else
  652. # if !1
  653. _GL_FUNCDECL_SYS (posix_spawn, int,
  654. (pid_t *_Restrict_ __pid,
  655. const char *_Restrict_ __path,
  656. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  657. const posix_spawnattr_t *_Restrict_ __attrp,
  658. char *const argv[_Restrict_arr_],
  659. char *const envp[_Restrict_arr_])
  660. _GL_ARG_NONNULL ((2, 5, 6)));
  661. # endif
  662. _GL_CXXALIAS_SYS (posix_spawn, int,
  663. (pid_t *_Restrict_ __pid,
  664. const char *_Restrict_ __path,
  665. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  666. const posix_spawnattr_t *_Restrict_ __attrp,
  667. char *const argv[_Restrict_arr_],
  668. char *const envp[_Restrict_arr_]));
  669. # endif
  670. _GL_CXXALIASWARN (posix_spawn);
  671. #elif defined GNULIB_POSIXCHECK
  672. # undef posix_spawn
  673. # if HAVE_RAW_DECL_POSIX_SPAWN
  674. _GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
  675. "use gnulib module posix_spawn for portability");
  676. # endif
  677. #endif
  678. #if 1
  679. /* Similar to 'posix_spawn' but search for FILE in the PATH.
  680. This function is a possible cancellation points and therefore not
  681. marked with __THROW. */
  682. # if 0
  683. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  684. # define posix_spawnp rpl_posix_spawnp
  685. # endif
  686. _GL_FUNCDECL_RPL (posix_spawnp, int,
  687. (pid_t *__pid, const char *__file,
  688. const posix_spawn_file_actions_t *__file_actions,
  689. const posix_spawnattr_t *__attrp,
  690. char *const argv[], char *const envp[])
  691. _GL_ARG_NONNULL ((2, 5, 6)));
  692. _GL_CXXALIAS_RPL (posix_spawnp, int,
  693. (pid_t *__pid, const char *__file,
  694. const posix_spawn_file_actions_t *__file_actions,
  695. const posix_spawnattr_t *__attrp,
  696. char *const argv[], char *const envp[]));
  697. # else
  698. # if !1
  699. _GL_FUNCDECL_SYS (posix_spawnp, int,
  700. (pid_t *__pid, const char *__file,
  701. const posix_spawn_file_actions_t *__file_actions,
  702. const posix_spawnattr_t *__attrp,
  703. char *const argv[], char *const envp[])
  704. _GL_ARG_NONNULL ((2, 5, 6)));
  705. # endif
  706. _GL_CXXALIAS_SYS (posix_spawnp, int,
  707. (pid_t *__pid, const char *__file,
  708. const posix_spawn_file_actions_t *__file_actions,
  709. const posix_spawnattr_t *__attrp,
  710. char *const argv[], char *const envp[]));
  711. # endif
  712. _GL_CXXALIASWARN (posix_spawnp);
  713. #elif defined GNULIB_POSIXCHECK
  714. # undef posix_spawnp
  715. # if HAVE_RAW_DECL_POSIX_SPAWNP
  716. _GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
  717. "use gnulib module posix_spawnp for portability");
  718. # endif
  719. #endif
  720. #if 0
  721. /* Initialize data structure with attributes for 'spawn' to default values. */
  722. # if 0
  723. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  724. # define posix_spawnattr_init rpl_posix_spawnattr_init
  725. # endif
  726. _GL_FUNCDECL_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
  727. __THROW _GL_ARG_NONNULL ((1)));
  728. _GL_CXXALIAS_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
  729. # else
  730. # if !1
  731. _GL_FUNCDECL_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
  732. __THROW _GL_ARG_NONNULL ((1)));
  733. # endif
  734. _GL_CXXALIAS_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
  735. # endif
  736. _GL_CXXALIASWARN (posix_spawnattr_init);
  737. #elif defined GNULIB_POSIXCHECK
  738. # undef posix_spawnattr_init
  739. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
  740. _GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
  741. "use gnulib module posix_spawnattr_init for portability");
  742. # endif
  743. #endif
  744. #if 0
  745. /* Free resources associated with ATTR. */
  746. # if 0
  747. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  748. # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
  749. # endif
  750. _GL_FUNCDECL_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
  751. __THROW _GL_ARG_NONNULL ((1)));
  752. _GL_CXXALIAS_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
  753. # else
  754. # if !1
  755. _GL_FUNCDECL_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
  756. __THROW _GL_ARG_NONNULL ((1)));
  757. # endif
  758. _GL_CXXALIAS_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
  759. # endif
  760. _GL_CXXALIASWARN (posix_spawnattr_destroy);
  761. #elif defined GNULIB_POSIXCHECK
  762. # undef posix_spawnattr_destroy
  763. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
  764. _GL_WARN_ON_USE (posix_spawnattr_destroy,
  765. "posix_spawnattr_destroy is unportable - "
  766. "use gnulib module posix_spawnattr_destroy for portability");
  767. # endif
  768. #endif
  769. #if 0
  770. /* Store signal mask for signals with default handling from ATTR in
  771. SIGDEFAULT. */
  772. # if 0
  773. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  774. # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
  775. # endif
  776. _GL_FUNCDECL_RPL (posix_spawnattr_getsigdefault, int,
  777. (const posix_spawnattr_t *_Restrict_ __attr,
  778. sigset_t *_Restrict_ __sigdefault)
  779. __THROW _GL_ARG_NONNULL ((1, 2)));
  780. _GL_CXXALIAS_RPL (posix_spawnattr_getsigdefault, int,
  781. (const posix_spawnattr_t *_Restrict_ __attr,
  782. sigset_t *_Restrict_ __sigdefault));
  783. # else
  784. # if !1
  785. _GL_FUNCDECL_SYS (posix_spawnattr_getsigdefault, int,
  786. (const posix_spawnattr_t *_Restrict_ __attr,
  787. sigset_t *_Restrict_ __sigdefault)
  788. __THROW _GL_ARG_NONNULL ((1, 2)));
  789. # endif
  790. _GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault, int,
  791. (const posix_spawnattr_t *_Restrict_ __attr,
  792. sigset_t *_Restrict_ __sigdefault));
  793. # endif
  794. _GL_CXXALIASWARN (posix_spawnattr_getsigdefault);
  795. #elif defined GNULIB_POSIXCHECK
  796. # undef posix_spawnattr_getsigdefault
  797. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
  798. _GL_WARN_ON_USE (posix_spawnattr_getsigdefault,
  799. "posix_spawnattr_getsigdefault is unportable - "
  800. "use gnulib module posix_spawnattr_getsigdefault for portability");
  801. # endif
  802. #endif
  803. #if 0
  804. /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
  805. # if 0
  806. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  807. # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
  808. # endif
  809. _GL_FUNCDECL_RPL (posix_spawnattr_setsigdefault, int,
  810. (posix_spawnattr_t *_Restrict_ __attr,
  811. const sigset_t *_Restrict_ __sigdefault)
  812. __THROW _GL_ARG_NONNULL ((1, 2)));
  813. _GL_CXXALIAS_RPL (posix_spawnattr_setsigdefault, int,
  814. (posix_spawnattr_t *_Restrict_ __attr,
  815. const sigset_t *_Restrict_ __sigdefault));
  816. # else
  817. # if !1
  818. _GL_FUNCDECL_SYS (posix_spawnattr_setsigdefault, int,
  819. (posix_spawnattr_t *_Restrict_ __attr,
  820. const sigset_t *_Restrict_ __sigdefault)
  821. __THROW _GL_ARG_NONNULL ((1, 2)));
  822. # endif
  823. _GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault, int,
  824. (posix_spawnattr_t *_Restrict_ __attr,
  825. const sigset_t *_Restrict_ __sigdefault));
  826. # endif
  827. _GL_CXXALIASWARN (posix_spawnattr_setsigdefault);
  828. #elif defined GNULIB_POSIXCHECK
  829. # undef posix_spawnattr_setsigdefault
  830. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
  831. _GL_WARN_ON_USE (posix_spawnattr_setsigdefault,
  832. "posix_spawnattr_setsigdefault is unportable - "
  833. "use gnulib module posix_spawnattr_setsigdefault for portability");
  834. # endif
  835. #endif
  836. #if 0
  837. /* Store signal mask for the new process from ATTR in SIGMASK. */
  838. # if 0
  839. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  840. # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
  841. # endif
  842. _GL_FUNCDECL_RPL (posix_spawnattr_getsigmask, int,
  843. (const posix_spawnattr_t *_Restrict_ __attr,
  844. sigset_t *_Restrict_ __sigmask)
  845. __THROW _GL_ARG_NONNULL ((1, 2)));
  846. _GL_CXXALIAS_RPL (posix_spawnattr_getsigmask, int,
  847. (const posix_spawnattr_t *_Restrict_ __attr,
  848. sigset_t *_Restrict_ __sigmask));
  849. # else
  850. # if !1
  851. _GL_FUNCDECL_SYS (posix_spawnattr_getsigmask, int,
  852. (const posix_spawnattr_t *_Restrict_ __attr,
  853. sigset_t *_Restrict_ __sigmask)
  854. __THROW _GL_ARG_NONNULL ((1, 2)));
  855. # endif
  856. _GL_CXXALIAS_SYS (posix_spawnattr_getsigmask, int,
  857. (const posix_spawnattr_t *_Restrict_ __attr,
  858. sigset_t *_Restrict_ __sigmask));
  859. # endif
  860. _GL_CXXALIASWARN (posix_spawnattr_getsigmask);
  861. #elif defined GNULIB_POSIXCHECK
  862. # undef posix_spawnattr_getsigmask
  863. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
  864. _GL_WARN_ON_USE (posix_spawnattr_getsigmask,
  865. "posix_spawnattr_getsigmask is unportable - "
  866. "use gnulib module posix_spawnattr_getsigmask for portability");
  867. # endif
  868. #endif
  869. #if 0
  870. /* Set signal mask for the new process in ATTR to SIGMASK. */
  871. # if 0
  872. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  873. # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
  874. # endif
  875. _GL_FUNCDECL_RPL (posix_spawnattr_setsigmask, int,
  876. (posix_spawnattr_t *_Restrict_ __attr,
  877. const sigset_t *_Restrict_ __sigmask)
  878. __THROW _GL_ARG_NONNULL ((1, 2)));
  879. _GL_CXXALIAS_RPL (posix_spawnattr_setsigmask, int,
  880. (posix_spawnattr_t *_Restrict_ __attr,
  881. const sigset_t *_Restrict_ __sigmask));
  882. # else
  883. # if !1
  884. _GL_FUNCDECL_SYS (posix_spawnattr_setsigmask, int,
  885. (posix_spawnattr_t *_Restrict_ __attr,
  886. const sigset_t *_Restrict_ __sigmask)
  887. __THROW _GL_ARG_NONNULL ((1, 2)));
  888. # endif
  889. _GL_CXXALIAS_SYS (posix_spawnattr_setsigmask, int,
  890. (posix_spawnattr_t *_Restrict_ __attr,
  891. const sigset_t *_Restrict_ __sigmask));
  892. # endif
  893. _GL_CXXALIASWARN (posix_spawnattr_setsigmask);
  894. #elif defined GNULIB_POSIXCHECK
  895. # undef posix_spawnattr_setsigmask
  896. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
  897. _GL_WARN_ON_USE (posix_spawnattr_setsigmask,
  898. "posix_spawnattr_setsigmask is unportable - "
  899. "use gnulib module posix_spawnattr_setsigmask for portability");
  900. # endif
  901. #endif
  902. #if 0
  903. /* Get flag word from the attribute structure. */
  904. # if 0
  905. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  906. # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
  907. # endif
  908. _GL_FUNCDECL_RPL (posix_spawnattr_getflags, int,
  909. (const posix_spawnattr_t *_Restrict_ __attr,
  910. short int *_Restrict_ __flags)
  911. __THROW _GL_ARG_NONNULL ((1, 2)));
  912. _GL_CXXALIAS_RPL (posix_spawnattr_getflags, int,
  913. (const posix_spawnattr_t *_Restrict_ __attr,
  914. short int *_Restrict_ __flags));
  915. # else
  916. # if !1
  917. _GL_FUNCDECL_SYS (posix_spawnattr_getflags, int,
  918. (const posix_spawnattr_t *_Restrict_ __attr,
  919. short int *_Restrict_ __flags)
  920. __THROW _GL_ARG_NONNULL ((1, 2)));
  921. # endif
  922. _GL_CXXALIAS_SYS (posix_spawnattr_getflags, int,
  923. (const posix_spawnattr_t *_Restrict_ __attr,
  924. short int *_Restrict_ __flags));
  925. # endif
  926. _GL_CXXALIASWARN (posix_spawnattr_getflags);
  927. #elif defined GNULIB_POSIXCHECK
  928. # undef posix_spawnattr_getflags
  929. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
  930. _GL_WARN_ON_USE (posix_spawnattr_getflags,
  931. "posix_spawnattr_getflags is unportable - "
  932. "use gnulib module posix_spawnattr_getflags for portability");
  933. # endif
  934. #endif
  935. #if 0
  936. /* Store flags in the attribute structure. */
  937. # if 0
  938. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  939. # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
  940. # endif
  941. _GL_FUNCDECL_RPL (posix_spawnattr_setflags, int,
  942. (posix_spawnattr_t *__attr, short int __flags)
  943. __THROW _GL_ARG_NONNULL ((1)));
  944. _GL_CXXALIAS_RPL (posix_spawnattr_setflags, int,
  945. (posix_spawnattr_t *__attr, short int __flags));
  946. # else
  947. # if !1
  948. _GL_FUNCDECL_SYS (posix_spawnattr_setflags, int,
  949. (posix_spawnattr_t *__attr, short int __flags)
  950. __THROW _GL_ARG_NONNULL ((1)));
  951. # endif
  952. _GL_CXXALIAS_SYS (posix_spawnattr_setflags, int,
  953. (posix_spawnattr_t *__attr, short int __flags));
  954. # endif
  955. _GL_CXXALIASWARN (posix_spawnattr_setflags);
  956. #elif defined GNULIB_POSIXCHECK
  957. # undef posix_spawnattr_setflags
  958. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
  959. _GL_WARN_ON_USE (posix_spawnattr_setflags,
  960. "posix_spawnattr_setflags is unportable - "
  961. "use gnulib module posix_spawnattr_setflags for portability");
  962. # endif
  963. #endif
  964. #if 0
  965. /* Get process group ID from the attribute structure. */
  966. # if 0
  967. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  968. # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
  969. # endif
  970. _GL_FUNCDECL_RPL (posix_spawnattr_getpgroup, int,
  971. (const posix_spawnattr_t *_Restrict_ __attr,
  972. pid_t *_Restrict_ __pgroup)
  973. __THROW _GL_ARG_NONNULL ((1, 2)));
  974. _GL_CXXALIAS_RPL (posix_spawnattr_getpgroup, int,
  975. (const posix_spawnattr_t *_Restrict_ __attr,
  976. pid_t *_Restrict_ __pgroup));
  977. # else
  978. # if !1
  979. _GL_FUNCDECL_SYS (posix_spawnattr_getpgroup, int,
  980. (const posix_spawnattr_t *_Restrict_ __attr,
  981. pid_t *_Restrict_ __pgroup)
  982. __THROW _GL_ARG_NONNULL ((1, 2)));
  983. # endif
  984. _GL_CXXALIAS_SYS (posix_spawnattr_getpgroup, int,
  985. (const posix_spawnattr_t *_Restrict_ __attr,
  986. pid_t *_Restrict_ __pgroup));
  987. # endif
  988. _GL_CXXALIASWARN (posix_spawnattr_getpgroup);
  989. #elif defined GNULIB_POSIXCHECK
  990. # undef posix_spawnattr_getpgroup
  991. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
  992. _GL_WARN_ON_USE (posix_spawnattr_getpgroup,
  993. "posix_spawnattr_getpgroup is unportable - "
  994. "use gnulib module posix_spawnattr_getpgroup for portability");
  995. # endif
  996. #endif
  997. #if 0
  998. /* Store process group ID in the attribute structure. */
  999. # if 0
  1000. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1001. # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
  1002. # endif
  1003. _GL_FUNCDECL_RPL (posix_spawnattr_setpgroup, int,
  1004. (posix_spawnattr_t *__attr, pid_t __pgroup)
  1005. __THROW _GL_ARG_NONNULL ((1)));
  1006. _GL_CXXALIAS_RPL (posix_spawnattr_setpgroup, int,
  1007. (posix_spawnattr_t *__attr, pid_t __pgroup));
  1008. # else
  1009. # if !1
  1010. _GL_FUNCDECL_SYS (posix_spawnattr_setpgroup, int,
  1011. (posix_spawnattr_t *__attr, pid_t __pgroup)
  1012. __THROW _GL_ARG_NONNULL ((1)));
  1013. # endif
  1014. _GL_CXXALIAS_SYS (posix_spawnattr_setpgroup, int,
  1015. (posix_spawnattr_t *__attr, pid_t __pgroup));
  1016. # endif
  1017. _GL_CXXALIASWARN (posix_spawnattr_setpgroup);
  1018. #elif defined GNULIB_POSIXCHECK
  1019. # undef posix_spawnattr_setpgroup
  1020. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
  1021. _GL_WARN_ON_USE (posix_spawnattr_setpgroup,
  1022. "posix_spawnattr_setpgroup is unportable - "
  1023. "use gnulib module posix_spawnattr_setpgroup for portability");
  1024. # endif
  1025. #endif
  1026. #if 0
  1027. /* Get scheduling policy from the attribute structure. */
  1028. # if 0
  1029. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1030. # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
  1031. # endif
  1032. _GL_FUNCDECL_RPL (posix_spawnattr_getschedpolicy, int,
  1033. (const posix_spawnattr_t *_Restrict_ __attr,
  1034. int *_Restrict_ __schedpolicy)
  1035. __THROW _GL_ARG_NONNULL ((1, 2)));
  1036. _GL_CXXALIAS_RPL (posix_spawnattr_getschedpolicy, int,
  1037. (const posix_spawnattr_t *_Restrict_ __attr,
  1038. int *_Restrict_ __schedpolicy));
  1039. # else
  1040. # if !1 || POSIX_SPAWN_SETSCHEDULER == 0
  1041. _GL_FUNCDECL_SYS (posix_spawnattr_getschedpolicy, int,
  1042. (const posix_spawnattr_t *_Restrict_ __attr,
  1043. int *_Restrict_ __schedpolicy)
  1044. __THROW _GL_ARG_NONNULL ((1, 2)));
  1045. # endif
  1046. _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
  1047. (const posix_spawnattr_t *_Restrict_ __attr,
  1048. int *_Restrict_ __schedpolicy));
  1049. # endif
  1050. # if __GLIBC__ >= 2
  1051. _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
  1052. # endif
  1053. #elif defined GNULIB_POSIXCHECK
  1054. # undef posix_spawnattr_getschedpolicy
  1055. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
  1056. _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy,
  1057. "posix_spawnattr_getschedpolicy is unportable - "
  1058. "use gnulib module posix_spawnattr_getschedpolicy for portability");
  1059. # endif
  1060. #endif
  1061. #if 0
  1062. /* Store scheduling policy in the attribute structure. */
  1063. # if 0
  1064. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1065. # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
  1066. # endif
  1067. _GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy, int,
  1068. (posix_spawnattr_t *__attr, int __schedpolicy)
  1069. __THROW _GL_ARG_NONNULL ((1)));
  1070. _GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy, int,
  1071. (posix_spawnattr_t *__attr, int __schedpolicy));
  1072. # else
  1073. # if !1 || POSIX_SPAWN_SETSCHEDULER == 0
  1074. _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
  1075. (posix_spawnattr_t *__attr, int __schedpolicy)
  1076. __THROW _GL_ARG_NONNULL ((1)));
  1077. # endif
  1078. _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
  1079. (posix_spawnattr_t *__attr, int __schedpolicy));
  1080. # endif
  1081. # if __GLIBC__ >= 2
  1082. _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
  1083. # endif
  1084. #elif defined GNULIB_POSIXCHECK
  1085. # undef posix_spawnattr_setschedpolicy
  1086. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
  1087. _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy,
  1088. "posix_spawnattr_setschedpolicy is unportable - "
  1089. "use gnulib module posix_spawnattr_setschedpolicy for portability");
  1090. # endif
  1091. #endif
  1092. #if 0
  1093. /* Get scheduling parameters from the attribute structure. */
  1094. # if 0
  1095. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1096. # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
  1097. # endif
  1098. _GL_FUNCDECL_RPL (posix_spawnattr_getschedparam, int,
  1099. (const posix_spawnattr_t *_Restrict_ __attr,
  1100. struct sched_param *_Restrict_ __schedparam)
  1101. __THROW _GL_ARG_NONNULL ((1, 2)));
  1102. _GL_CXXALIAS_RPL (posix_spawnattr_getschedparam, int,
  1103. (const posix_spawnattr_t *_Restrict_ __attr,
  1104. struct sched_param *_Restrict_ __schedparam));
  1105. # else
  1106. # if !1 || POSIX_SPAWN_SETSCHEDPARAM == 0
  1107. _GL_FUNCDECL_SYS (posix_spawnattr_getschedparam, int,
  1108. (const posix_spawnattr_t *_Restrict_ __attr,
  1109. struct sched_param *_Restrict_ __schedparam)
  1110. __THROW _GL_ARG_NONNULL ((1, 2)));
  1111. # endif
  1112. _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
  1113. (const posix_spawnattr_t *_Restrict_ __attr,
  1114. struct sched_param *_Restrict_ __schedparam));
  1115. # endif
  1116. # if __GLIBC__ >= 2
  1117. _GL_CXXALIASWARN (posix_spawnattr_getschedparam);
  1118. # endif
  1119. #elif defined GNULIB_POSIXCHECK
  1120. # undef posix_spawnattr_getschedparam
  1121. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
  1122. _GL_WARN_ON_USE (posix_spawnattr_getschedparam,
  1123. "posix_spawnattr_getschedparam is unportable - "
  1124. "use gnulib module posix_spawnattr_getschedparam for portability");
  1125. # endif
  1126. #endif
  1127. #if 0
  1128. /* Store scheduling parameters in the attribute structure. */
  1129. # if 0
  1130. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1131. # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
  1132. # endif
  1133. _GL_FUNCDECL_RPL (posix_spawnattr_setschedparam, int,
  1134. (posix_spawnattr_t *_Restrict_ __attr,
  1135. const struct sched_param *_Restrict_ __schedparam)
  1136. __THROW _GL_ARG_NONNULL ((1, 2)));
  1137. _GL_CXXALIAS_RPL (posix_spawnattr_setschedparam, int,
  1138. (posix_spawnattr_t *_Restrict_ __attr,
  1139. const struct sched_param *_Restrict_ __schedparam));
  1140. # else
  1141. # if !1 || POSIX_SPAWN_SETSCHEDPARAM == 0
  1142. _GL_FUNCDECL_SYS (posix_spawnattr_setschedparam, int,
  1143. (posix_spawnattr_t *_Restrict_ __attr,
  1144. const struct sched_param *_Restrict_ __schedparam)
  1145. __THROW _GL_ARG_NONNULL ((1, 2)));
  1146. # endif
  1147. _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
  1148. (posix_spawnattr_t *_Restrict_ __attr,
  1149. const struct sched_param *_Restrict_ __schedparam));
  1150. # endif
  1151. # if __GLIBC__ >= 2
  1152. _GL_CXXALIASWARN (posix_spawnattr_setschedparam);
  1153. # endif
  1154. #elif defined GNULIB_POSIXCHECK
  1155. # undef posix_spawnattr_setschedparam
  1156. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
  1157. _GL_WARN_ON_USE (posix_spawnattr_setschedparam,
  1158. "posix_spawnattr_setschedparam is unportable - "
  1159. "use gnulib module posix_spawnattr_setschedparam for portability");
  1160. # endif
  1161. #endif
  1162. #if 0
  1163. /* Initialize data structure for file attribute for 'spawn' call. */
  1164. # if 0
  1165. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1166. # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
  1167. # endif
  1168. _GL_FUNCDECL_RPL (posix_spawn_file_actions_init, int,
  1169. (posix_spawn_file_actions_t *__file_actions)
  1170. __THROW _GL_ARG_NONNULL ((1)));
  1171. _GL_CXXALIAS_RPL (posix_spawn_file_actions_init, int,
  1172. (posix_spawn_file_actions_t *__file_actions));
  1173. # else
  1174. # if !1
  1175. _GL_FUNCDECL_SYS (posix_spawn_file_actions_init, int,
  1176. (posix_spawn_file_actions_t *__file_actions)
  1177. __THROW _GL_ARG_NONNULL ((1)));
  1178. # endif
  1179. _GL_CXXALIAS_SYS (posix_spawn_file_actions_init, int,
  1180. (posix_spawn_file_actions_t *__file_actions));
  1181. # endif
  1182. _GL_CXXALIASWARN (posix_spawn_file_actions_init);
  1183. #elif defined GNULIB_POSIXCHECK
  1184. # undef posix_spawn_file_actions_init
  1185. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
  1186. _GL_WARN_ON_USE (posix_spawn_file_actions_init,
  1187. "posix_spawn_file_actions_init is unportable - "
  1188. "use gnulib module posix_spawn_file_actions_init for portability");
  1189. # endif
  1190. #endif
  1191. #if 0
  1192. /* Free resources associated with FILE-ACTIONS. */
  1193. # if 0
  1194. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1195. # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
  1196. # endif
  1197. _GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy, int,
  1198. (posix_spawn_file_actions_t *__file_actions)
  1199. __THROW _GL_ARG_NONNULL ((1)));
  1200. _GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy, int,
  1201. (posix_spawn_file_actions_t *__file_actions));
  1202. # else
  1203. # if !1
  1204. _GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy, int,
  1205. (posix_spawn_file_actions_t *__file_actions)
  1206. __THROW _GL_ARG_NONNULL ((1)));
  1207. # endif
  1208. _GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy, int,
  1209. (posix_spawn_file_actions_t *__file_actions));
  1210. # endif
  1211. _GL_CXXALIASWARN (posix_spawn_file_actions_destroy);
  1212. #elif defined GNULIB_POSIXCHECK
  1213. # undef posix_spawn_file_actions_destroy
  1214. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
  1215. _GL_WARN_ON_USE (posix_spawn_file_actions_destroy,
  1216. "posix_spawn_file_actions_destroy is unportable - "
  1217. "use gnulib module posix_spawn_file_actions_destroy for portability");
  1218. # endif
  1219. #endif
  1220. #if 0
  1221. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1222. 'open' for the given file during the 'spawn' call. */
  1223. # if 0
  1224. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1225. # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
  1226. # endif
  1227. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen, int,
  1228. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1229. int __fd,
  1230. const char *_Restrict_ __path, int __oflag, mode_t __mode)
  1231. __THROW _GL_ARG_NONNULL ((1, 3)));
  1232. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen, int,
  1233. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1234. int __fd,
  1235. const char *_Restrict_ __path, int __oflag, mode_t __mode));
  1236. # else
  1237. # if !1
  1238. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen, int,
  1239. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1240. int __fd,
  1241. const char *_Restrict_ __path, int __oflag, mode_t __mode)
  1242. __THROW _GL_ARG_NONNULL ((1, 3)));
  1243. # endif
  1244. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int,
  1245. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1246. int __fd,
  1247. const char *_Restrict_ __path, int __oflag, mode_t __mode));
  1248. # endif
  1249. # if __GLIBC__ >= 2
  1250. _GL_CXXALIASWARN (posix_spawn_file_actions_addopen);
  1251. # endif
  1252. #elif defined GNULIB_POSIXCHECK
  1253. # undef posix_spawn_file_actions_addopen
  1254. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
  1255. _GL_WARN_ON_USE (posix_spawn_file_actions_addopen,
  1256. "posix_spawn_file_actions_addopen is unportable - "
  1257. "use gnulib module posix_spawn_file_actions_addopen for portability");
  1258. # endif
  1259. #endif
  1260. #if 0
  1261. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1262. 'close' for the given file descriptor during the 'spawn' call. */
  1263. # if 0
  1264. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1265. # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
  1266. # endif
  1267. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose, int,
  1268. (posix_spawn_file_actions_t *__file_actions, int __fd)
  1269. __THROW _GL_ARG_NONNULL ((1)));
  1270. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose, int,
  1271. (posix_spawn_file_actions_t *__file_actions, int __fd));
  1272. # else
  1273. # if !1
  1274. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int,
  1275. (posix_spawn_file_actions_t *__file_actions, int __fd)
  1276. __THROW _GL_ARG_NONNULL ((1)));
  1277. # endif
  1278. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int,
  1279. (posix_spawn_file_actions_t *__file_actions, int __fd));
  1280. # endif
  1281. # if __GLIBC__ >= 2
  1282. _GL_CXXALIASWARN (posix_spawn_file_actions_addclose);
  1283. # endif
  1284. #elif defined GNULIB_POSIXCHECK
  1285. # undef posix_spawn_file_actions_addclose
  1286. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
  1287. _GL_WARN_ON_USE (posix_spawn_file_actions_addclose,
  1288. "posix_spawn_file_actions_addclose is unportable - "
  1289. "use gnulib module posix_spawn_file_actions_addclose for portability");
  1290. # endif
  1291. #endif
  1292. #if 0
  1293. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1294. 'dup2' for the given file descriptors during the 'spawn' call. */
  1295. # if 0
  1296. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1297. # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
  1298. # endif
  1299. _GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2, int,
  1300. (posix_spawn_file_actions_t *__file_actions,
  1301. int __fd, int __newfd)
  1302. __THROW _GL_ARG_NONNULL ((1)));
  1303. _GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2, int,
  1304. (posix_spawn_file_actions_t *__file_actions,
  1305. int __fd, int __newfd));
  1306. # else
  1307. # if !1
  1308. _GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2, int,
  1309. (posix_spawn_file_actions_t *__file_actions,
  1310. int __fd, int __newfd)
  1311. __THROW _GL_ARG_NONNULL ((1)));
  1312. # endif
  1313. _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int,
  1314. (posix_spawn_file_actions_t *__file_actions,
  1315. int __fd, int __newfd));
  1316. # endif
  1317. # if __GLIBC__ >= 2
  1318. _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2);
  1319. # endif
  1320. #elif defined GNULIB_POSIXCHECK
  1321. # undef posix_spawn_file_actions_adddup2
  1322. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
  1323. _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2,
  1324. "posix_spawn_file_actions_adddup2 is unportable - "
  1325. "use gnulib module posix_spawn_file_actions_adddup2 for portability");
  1326. # endif
  1327. #endif
  1328. #if 0
  1329. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1330. 'chdir' to the given directory during the 'spawn' call. */
  1331. # if 0
  1332. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1333. # define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir
  1334. # endif
  1335. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir, int,
  1336. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1337. const char *_Restrict_ __path)
  1338. __THROW _GL_ARG_NONNULL ((1, 2)));
  1339. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir, int,
  1340. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1341. const char *_Restrict_ __path));
  1342. # else
  1343. # if !1
  1344. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir, int,
  1345. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1346. const char *_Restrict_ __path)
  1347. __THROW _GL_ARG_NONNULL ((1, 2)));
  1348. # endif
  1349. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir, int,
  1350. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1351. const char *_Restrict_ __path));
  1352. # endif
  1353. _GL_CXXALIASWARN (posix_spawn_file_actions_addchdir);
  1354. #elif defined GNULIB_POSIXCHECK
  1355. # undef posix_spawn_file_actions_addchdir
  1356. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
  1357. _GL_WARN_ON_USE (posix_spawn_file_actions_addchdir,
  1358. "posix_spawn_file_actions_addchdir is unportable - "
  1359. "use gnulib module posix_spawn_file_actions_addchdir for portability");
  1360. # endif
  1361. #endif
  1362. #if 0
  1363. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1364. 'fchdir' to the given directory during the 'spawn' call. */
  1365. # if 0
  1366. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1367. # define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir
  1368. # endif
  1369. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int,
  1370. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1371. int __fd)
  1372. __THROW _GL_ARG_NONNULL ((1)));
  1373. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int,
  1374. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1375. int __fd));
  1376. # else
  1377. # if !1
  1378. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int,
  1379. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1380. int __fd)
  1381. __THROW _GL_ARG_NONNULL ((1)));
  1382. # endif
  1383. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int,
  1384. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1385. int __fd));
  1386. # endif
  1387. _GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir);
  1388. #elif defined GNULIB_POSIXCHECK
  1389. # undef posix_spawn_file_actions_addfchdir
  1390. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
  1391. _GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
  1392. "posix_spawn_file_actions_addfchdir is unportable - "
  1393. "use gnulib module posix_spawn_file_actions_addfchdir for portability");
  1394. # endif
  1395. #endif
  1396. #endif /* _GL_SPAWN_H */
  1397. #endif /* _GL_SPAWN_H */
  1398. #endif