spawn.h 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
  2. /* Definitions for POSIX spawn interface.
  3. Copyright (C) 2000, 2003-2004, 2008-2013 Free Software Foundation, Inc.
  4. This file is part of the GNU C Library.
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program 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 General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef _GL_M4_SPAWN_H
  16. #if __GNUC__ >= 3
  17. #endif
  18. /* The include_next requires a split double-inclusion guard. */
  19. #if 0
  20. # include <spawn.h>
  21. #endif
  22. #ifndef _GL_M4_SPAWN_H
  23. #define _GL_M4_SPAWN_H
  24. /* Get definitions of 'struct sched_param' and 'sigset_t'.
  25. But avoid namespace pollution on glibc systems. */
  26. #if !(defined __GLIBC__ && !defined __UCLIBC__)
  27. # include <sched.h>
  28. # include <signal.h>
  29. #endif
  30. #include <sys/types.h>
  31. #ifndef __THROW
  32. # define __THROW
  33. #endif
  34. /* GCC 2.95 and later have "__restrict"; C99 compilers have
  35. "restrict", and "configure" may have defined "restrict".
  36. Other compilers use __restrict, __restrict__, and _Restrict, and
  37. 'configure' might #define 'restrict' to those words, so pick a
  38. different name. */
  39. #ifndef _Restrict_
  40. # if 199901L <= __STDC_VERSION__
  41. # define _Restrict_ restrict
  42. # elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
  43. # define _Restrict_ __restrict
  44. # else
  45. # define _Restrict_
  46. # endif
  47. #endif
  48. /* gcc 3.1 and up support the [restrict] syntax. Don't trust
  49. sys/cdefs.h's definition of __restrict_arr, though, as it
  50. mishandles gcc -ansi -pedantic. */
  51. #ifndef _Restrict_arr_
  52. # if ((199901L <= __STDC_VERSION__ \
  53. || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__)) \
  54. && !defined __STRICT_ANSI__)) \
  55. && !defined __GNUG__)
  56. # define _Restrict_arr_ _Restrict_
  57. # else
  58. # define _Restrict_arr_
  59. # endif
  60. #endif
  61. /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
  62. #ifndef _GL_CXXDEFS_H
  63. #define _GL_CXXDEFS_H
  64. /* The three most frequent use cases of these macros are:
  65. * For providing a substitute for a function that is missing on some
  66. platforms, but is declared and works fine on the platforms on which
  67. it exists:
  68. #if @GNULIB_FOO@
  69. # if !@HAVE_FOO@
  70. _GL_FUNCDECL_SYS (foo, ...);
  71. # endif
  72. _GL_CXXALIAS_SYS (foo, ...);
  73. _GL_CXXALIASWARN (foo);
  74. #elif defined GNULIB_POSIXCHECK
  75. ...
  76. #endif
  77. * For providing a replacement for a function that exists on all platforms,
  78. but is broken/insufficient and needs to be replaced on some platforms:
  79. #if @GNULIB_FOO@
  80. # if @REPLACE_FOO@
  81. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  82. # undef foo
  83. # define foo rpl_foo
  84. # endif
  85. _GL_FUNCDECL_RPL (foo, ...);
  86. _GL_CXXALIAS_RPL (foo, ...);
  87. # else
  88. _GL_CXXALIAS_SYS (foo, ...);
  89. # endif
  90. _GL_CXXALIASWARN (foo);
  91. #elif defined GNULIB_POSIXCHECK
  92. ...
  93. #endif
  94. * For providing a replacement for a function that exists on some platforms
  95. but is broken/insufficient and needs to be replaced on some of them and
  96. is additionally either missing or undeclared on some other platforms:
  97. #if @GNULIB_FOO@
  98. # if @REPLACE_FOO@
  99. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  100. # undef foo
  101. # define foo rpl_foo
  102. # endif
  103. _GL_FUNCDECL_RPL (foo, ...);
  104. _GL_CXXALIAS_RPL (foo, ...);
  105. # else
  106. # if !@HAVE_FOO@ or if !@HAVE_DECL_FOO@
  107. _GL_FUNCDECL_SYS (foo, ...);
  108. # endif
  109. _GL_CXXALIAS_SYS (foo, ...);
  110. # endif
  111. _GL_CXXALIASWARN (foo);
  112. #elif defined GNULIB_POSIXCHECK
  113. ...
  114. #endif
  115. */
  116. /* _GL_EXTERN_C declaration;
  117. performs the declaration with C linkage. */
  118. #if defined __cplusplus
  119. # define _GL_EXTERN_C extern "C"
  120. #else
  121. # define _GL_EXTERN_C extern
  122. #endif
  123. /* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
  124. declares a replacement function, named rpl_func, with the given prototype,
  125. consisting of return type, parameters, and attributes.
  126. Example:
  127. _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
  128. _GL_ARG_NONNULL ((1)));
  129. */
  130. #define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
  131. _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
  132. #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
  133. _GL_EXTERN_C rettype rpl_func parameters_and_attributes
  134. /* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
  135. declares the system function, named func, with the given prototype,
  136. consisting of return type, parameters, and attributes.
  137. Example:
  138. _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
  139. _GL_ARG_NONNULL ((1)));
  140. */
  141. #define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
  142. _GL_EXTERN_C rettype func parameters_and_attributes
  143. /* _GL_CXXALIAS_RPL (func, rettype, parameters);
  144. declares a C++ alias called GNULIB_NAMESPACE::func
  145. that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
  146. Example:
  147. _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
  148. */
  149. #define _GL_CXXALIAS_RPL(func,rettype,parameters) \
  150. _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
  151. #if defined __cplusplus && defined GNULIB_NAMESPACE
  152. # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
  153. namespace GNULIB_NAMESPACE \
  154. { \
  155. rettype (*const func) parameters = ::rpl_func; \
  156. } \
  157. _GL_EXTERN_C int _gl_cxxalias_dummy
  158. #else
  159. # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
  160. _GL_EXTERN_C int _gl_cxxalias_dummy
  161. #endif
  162. /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
  163. is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
  164. except that the C function rpl_func may have a slightly different
  165. declaration. A cast is used to silence the "invalid conversion" error
  166. that would otherwise occur. */
  167. #if defined __cplusplus && defined GNULIB_NAMESPACE
  168. # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
  169. namespace GNULIB_NAMESPACE \
  170. { \
  171. rettype (*const func) parameters = \
  172. reinterpret_cast<rettype(*)parameters>(::rpl_func); \
  173. } \
  174. _GL_EXTERN_C int _gl_cxxalias_dummy
  175. #else
  176. # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
  177. _GL_EXTERN_C int _gl_cxxalias_dummy
  178. #endif
  179. /* _GL_CXXALIAS_SYS (func, rettype, parameters);
  180. declares a C++ alias called GNULIB_NAMESPACE::func
  181. that redirects to the system provided function func, if GNULIB_NAMESPACE
  182. is defined.
  183. Example:
  184. _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
  185. */
  186. #if defined __cplusplus && defined GNULIB_NAMESPACE
  187. /* If we were to write
  188. rettype (*const func) parameters = ::func;
  189. like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
  190. better (remove an indirection through a 'static' pointer variable),
  191. but then the _GL_CXXALIASWARN macro below would cause a warning not only
  192. for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */
  193. # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
  194. namespace GNULIB_NAMESPACE \
  195. { \
  196. static rettype (*func) parameters = ::func; \
  197. } \
  198. _GL_EXTERN_C int _gl_cxxalias_dummy
  199. #else
  200. # define _GL_CXXALIAS_SYS(func,rettype,parameters) \
  201. _GL_EXTERN_C int _gl_cxxalias_dummy
  202. #endif
  203. /* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
  204. is like _GL_CXXALIAS_SYS (func, rettype, parameters);
  205. except that the C function func may have a slightly different declaration.
  206. A cast is used to silence the "invalid conversion" error that would
  207. otherwise occur. */
  208. #if defined __cplusplus && defined GNULIB_NAMESPACE
  209. # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
  210. namespace GNULIB_NAMESPACE \
  211. { \
  212. static rettype (*func) parameters = \
  213. reinterpret_cast<rettype(*)parameters>(::func); \
  214. } \
  215. _GL_EXTERN_C int _gl_cxxalias_dummy
  216. #else
  217. # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
  218. _GL_EXTERN_C int _gl_cxxalias_dummy
  219. #endif
  220. /* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
  221. is like _GL_CXXALIAS_SYS (func, rettype, parameters);
  222. except that the C function is picked among a set of overloaded functions,
  223. namely the one with rettype2 and parameters2. Two consecutive casts
  224. are used to silence the "cannot find a match" and "invalid conversion"
  225. errors that would otherwise occur. */
  226. #if defined __cplusplus && defined GNULIB_NAMESPACE
  227. /* The outer cast must be a reinterpret_cast.
  228. The inner cast: When the function is defined as a set of overloaded
  229. functions, it works as a static_cast<>, choosing the designated variant.
  230. When the function is defined as a single variant, it works as a
  231. reinterpret_cast<>. The parenthesized cast syntax works both ways. */
  232. # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
  233. namespace GNULIB_NAMESPACE \
  234. { \
  235. static rettype (*func) parameters = \
  236. reinterpret_cast<rettype(*)parameters>( \
  237. (rettype2(*)parameters2)(::func)); \
  238. } \
  239. _GL_EXTERN_C int _gl_cxxalias_dummy
  240. #else
  241. # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
  242. _GL_EXTERN_C int _gl_cxxalias_dummy
  243. #endif
  244. /* _GL_CXXALIASWARN (func);
  245. causes a warning to be emitted when ::func is used but not when
  246. GNULIB_NAMESPACE::func is used. func must be defined without overloaded
  247. variants. */
  248. #if defined __cplusplus && defined GNULIB_NAMESPACE
  249. # define _GL_CXXALIASWARN(func) \
  250. _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
  251. # define _GL_CXXALIASWARN_1(func,namespace) \
  252. _GL_CXXALIASWARN_2 (func, namespace)
  253. /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
  254. we enable the warning only when not optimizing. */
  255. # if !__OPTIMIZE__
  256. # define _GL_CXXALIASWARN_2(func,namespace) \
  257. _GL_WARN_ON_USE (func, \
  258. "The symbol ::" #func " refers to the system function. " \
  259. "Use " #namespace "::" #func " instead.")
  260. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  261. # define _GL_CXXALIASWARN_2(func,namespace) \
  262. extern __typeof__ (func) func
  263. # else
  264. # define _GL_CXXALIASWARN_2(func,namespace) \
  265. _GL_EXTERN_C int _gl_cxxalias_dummy
  266. # endif
  267. #else
  268. # define _GL_CXXALIASWARN(func) \
  269. _GL_EXTERN_C int _gl_cxxalias_dummy
  270. #endif
  271. /* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
  272. causes a warning to be emitted when the given overloaded variant of ::func
  273. is used but not when GNULIB_NAMESPACE::func is used. */
  274. #if defined __cplusplus && defined GNULIB_NAMESPACE
  275. # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
  276. _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
  277. GNULIB_NAMESPACE)
  278. # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
  279. _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
  280. /* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
  281. we enable the warning only when not optimizing. */
  282. # if !__OPTIMIZE__
  283. # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
  284. _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
  285. "The symbol ::" #func " refers to the system function. " \
  286. "Use " #namespace "::" #func " instead.")
  287. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  288. # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
  289. extern __typeof__ (func) func
  290. # else
  291. # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
  292. _GL_EXTERN_C int _gl_cxxalias_dummy
  293. # endif
  294. #else
  295. # define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
  296. _GL_EXTERN_C int _gl_cxxalias_dummy
  297. #endif
  298. #endif /* _GL_CXXDEFS_H */
  299. /* The definition of _GL_ARG_NONNULL is copied here. */
  300. /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
  301. that the values passed as arguments n, ..., m must be non-NULL pointers.
  302. n = 1 stands for the first argument, n = 2 for the second argument etc. */
  303. #ifndef _GL_ARG_NONNULL
  304. # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
  305. # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
  306. # else
  307. # define _GL_ARG_NONNULL(params)
  308. # endif
  309. #endif
  310. /* The definition of _GL_WARN_ON_USE is copied here. */
  311. #ifndef _GL_WARN_ON_USE
  312. # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
  313. /* A compiler attribute is available in gcc versions 4.3.0 and later. */
  314. # define _GL_WARN_ON_USE(function, message) \
  315. extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
  316. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  317. /* Verify the existence of the function. */
  318. # define _GL_WARN_ON_USE(function, message) \
  319. extern __typeof__ (function) function
  320. # else /* Unsupported. */
  321. # define _GL_WARN_ON_USE(function, message) \
  322. _GL_WARN_EXTERN_C int _gl_warn_on_use
  323. # endif
  324. #endif
  325. /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
  326. is like _GL_WARN_ON_USE (function, "string"), except that the function is
  327. declared with the given prototype, consisting of return type, parameters,
  328. and attributes.
  329. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
  330. not work in this case. */
  331. #ifndef _GL_WARN_ON_USE_CXX
  332. # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
  333. # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
  334. extern rettype function parameters_and_attributes \
  335. __attribute__ ((__warning__ (msg)))
  336. # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
  337. /* Verify the existence of the function. */
  338. # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
  339. extern rettype function parameters_and_attributes
  340. # else /* Unsupported. */
  341. # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
  342. _GL_WARN_EXTERN_C int _gl_warn_on_use
  343. # endif
  344. #endif
  345. /* _GL_WARN_EXTERN_C declaration;
  346. performs the declaration with C linkage. */
  347. #ifndef _GL_WARN_EXTERN_C
  348. # if defined __cplusplus
  349. # define _GL_WARN_EXTERN_C extern "C"
  350. # else
  351. # define _GL_WARN_EXTERN_C extern
  352. # endif
  353. #endif
  354. /* Data structure to contain attributes for thread creation. */
  355. #if 0
  356. # define posix_spawnattr_t rpl_posix_spawnattr_t
  357. #endif
  358. #if 0 || !0
  359. # if !GNULIB_defined_posix_spawnattr_t
  360. typedef struct
  361. {
  362. short int _flags;
  363. pid_t _pgrp;
  364. sigset_t _sd;
  365. sigset_t _ss;
  366. struct sched_param _sp;
  367. int _policy;
  368. int __pad[16];
  369. } posix_spawnattr_t;
  370. # define GNULIB_defined_posix_spawnattr_t 1
  371. # endif
  372. #endif
  373. /* Data structure to contain information about the actions to be
  374. performed in the new process with respect to file descriptors. */
  375. #if 0
  376. # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
  377. #endif
  378. #if 0 || !0
  379. # if !GNULIB_defined_posix_spawn_file_actions_t
  380. typedef struct
  381. {
  382. int _allocated;
  383. int _used;
  384. struct __spawn_action *_actions;
  385. int __pad[16];
  386. } posix_spawn_file_actions_t;
  387. # define GNULIB_defined_posix_spawn_file_actions_t 1
  388. # endif
  389. #endif
  390. /* Flags to be set in the 'posix_spawnattr_t'. */
  391. #if 0
  392. /* Use the values from the system, but provide the missing ones. */
  393. # ifndef POSIX_SPAWN_SETSCHEDPARAM
  394. # define POSIX_SPAWN_SETSCHEDPARAM 0
  395. # endif
  396. # ifndef POSIX_SPAWN_SETSCHEDULER
  397. # define POSIX_SPAWN_SETSCHEDULER 0
  398. # endif
  399. #else
  400. # if 0
  401. /* Use the values from the system, for better compatibility. */
  402. /* But this implementation does not support AIX extensions. */
  403. # undef POSIX_SPAWN_FORK_HANDLERS
  404. # else
  405. # define POSIX_SPAWN_RESETIDS 0x01
  406. # define POSIX_SPAWN_SETPGROUP 0x02
  407. # define POSIX_SPAWN_SETSIGDEF 0x04
  408. # define POSIX_SPAWN_SETSIGMASK 0x08
  409. # define POSIX_SPAWN_SETSCHEDPARAM 0x10
  410. # define POSIX_SPAWN_SETSCHEDULER 0x20
  411. # endif
  412. #endif
  413. /* A GNU extension. Use the next free bit position. */
  414. #define POSIX_SPAWN_USEVFORK \
  415. ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1) \
  416. | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1) \
  417. | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1) \
  418. | POSIX_SPAWN_SETSIGMASK | (POSIX_SPAWN_SETSIGMASK - 1) \
  419. | POSIX_SPAWN_SETSCHEDPARAM \
  420. | (POSIX_SPAWN_SETSCHEDPARAM > 0 ? POSIX_SPAWN_SETSCHEDPARAM - 1 : 0) \
  421. | POSIX_SPAWN_SETSCHEDULER \
  422. | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
  423. + 1)
  424. #if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
  425. typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
  426. [(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
  427. | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
  428. | POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
  429. & POSIX_SPAWN_USEVFORK)
  430. == 0)
  431. ? 1 : -1];
  432. # define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
  433. #endif
  434. #if 0
  435. /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
  436. Before running the process perform the actions described in FILE-ACTIONS.
  437. This function is a possible cancellation points and therefore not
  438. marked with __THROW. */
  439. # if 0
  440. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  441. # define posix_spawn rpl_posix_spawn
  442. # endif
  443. _GL_FUNCDECL_RPL (posix_spawn, int,
  444. (pid_t *_Restrict_ __pid,
  445. const char *_Restrict_ __path,
  446. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  447. const posix_spawnattr_t *_Restrict_ __attrp,
  448. char *const argv[_Restrict_arr_],
  449. char *const envp[_Restrict_arr_])
  450. _GL_ARG_NONNULL ((2, 5, 6)));
  451. _GL_CXXALIAS_RPL (posix_spawn, int,
  452. (pid_t *_Restrict_ __pid,
  453. const char *_Restrict_ __path,
  454. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  455. const posix_spawnattr_t *_Restrict_ __attrp,
  456. char *const argv[_Restrict_arr_],
  457. char *const envp[_Restrict_arr_]));
  458. # else
  459. # if !0
  460. _GL_FUNCDECL_SYS (posix_spawn, int,
  461. (pid_t *_Restrict_ __pid,
  462. const char *_Restrict_ __path,
  463. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  464. const posix_spawnattr_t *_Restrict_ __attrp,
  465. char *const argv[_Restrict_arr_],
  466. char *const envp[_Restrict_arr_])
  467. _GL_ARG_NONNULL ((2, 5, 6)));
  468. # endif
  469. _GL_CXXALIAS_SYS (posix_spawn, int,
  470. (pid_t *_Restrict_ __pid,
  471. const char *_Restrict_ __path,
  472. const posix_spawn_file_actions_t *_Restrict_ __file_actions,
  473. const posix_spawnattr_t *_Restrict_ __attrp,
  474. char *const argv[_Restrict_arr_],
  475. char *const envp[_Restrict_arr_]));
  476. # endif
  477. _GL_CXXALIASWARN (posix_spawn);
  478. #elif defined GNULIB_POSIXCHECK
  479. # undef posix_spawn
  480. # if HAVE_RAW_DECL_POSIX_SPAWN
  481. _GL_WARN_ON_USE (posix_spawn, "posix_spawn is unportable - "
  482. "use gnulib module posix_spawn for portability");
  483. # endif
  484. #endif
  485. #if 1
  486. /* Similar to 'posix_spawn' but search for FILE in the PATH.
  487. This function is a possible cancellation points and therefore not
  488. marked with __THROW. */
  489. # if 0
  490. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  491. # define posix_spawnp rpl_posix_spawnp
  492. # endif
  493. _GL_FUNCDECL_RPL (posix_spawnp, int,
  494. (pid_t *__pid, const char *__file,
  495. const posix_spawn_file_actions_t *__file_actions,
  496. const posix_spawnattr_t *__attrp,
  497. char *const argv[], char *const envp[])
  498. _GL_ARG_NONNULL ((2, 5, 6)));
  499. _GL_CXXALIAS_RPL (posix_spawnp, int,
  500. (pid_t *__pid, const char *__file,
  501. const posix_spawn_file_actions_t *__file_actions,
  502. const posix_spawnattr_t *__attrp,
  503. char *const argv[], char *const envp[]));
  504. # else
  505. # if !0
  506. _GL_FUNCDECL_SYS (posix_spawnp, int,
  507. (pid_t *__pid, const char *__file,
  508. const posix_spawn_file_actions_t *__file_actions,
  509. const posix_spawnattr_t *__attrp,
  510. char *const argv[], char *const envp[])
  511. _GL_ARG_NONNULL ((2, 5, 6)));
  512. # endif
  513. _GL_CXXALIAS_SYS (posix_spawnp, int,
  514. (pid_t *__pid, const char *__file,
  515. const posix_spawn_file_actions_t *__file_actions,
  516. const posix_spawnattr_t *__attrp,
  517. char *const argv[], char *const envp[]));
  518. # endif
  519. _GL_CXXALIASWARN (posix_spawnp);
  520. #elif defined GNULIB_POSIXCHECK
  521. # undef posix_spawnp
  522. # if HAVE_RAW_DECL_POSIX_SPAWNP
  523. _GL_WARN_ON_USE (posix_spawnp, "posix_spawnp is unportable - "
  524. "use gnulib module posix_spawnp for portability");
  525. # endif
  526. #endif
  527. #if 1
  528. /* Initialize data structure with attributes for 'spawn' to default values. */
  529. # if 0
  530. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  531. # define posix_spawnattr_init rpl_posix_spawnattr_init
  532. # endif
  533. _GL_FUNCDECL_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
  534. __THROW _GL_ARG_NONNULL ((1)));
  535. _GL_CXXALIAS_RPL (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
  536. # else
  537. # if !0
  538. _GL_FUNCDECL_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr)
  539. __THROW _GL_ARG_NONNULL ((1)));
  540. # endif
  541. _GL_CXXALIAS_SYS (posix_spawnattr_init, int, (posix_spawnattr_t *__attr));
  542. # endif
  543. _GL_CXXALIASWARN (posix_spawnattr_init);
  544. #elif defined GNULIB_POSIXCHECK
  545. # undef posix_spawnattr_init
  546. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT
  547. _GL_WARN_ON_USE (posix_spawnattr_init, "posix_spawnattr_init is unportable - "
  548. "use gnulib module posix_spawnattr_init for portability");
  549. # endif
  550. #endif
  551. #if 1
  552. /* Free resources associated with ATTR. */
  553. # if 0
  554. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  555. # define posix_spawnattr_destroy rpl_posix_spawnattr_destroy
  556. # endif
  557. _GL_FUNCDECL_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
  558. __THROW _GL_ARG_NONNULL ((1)));
  559. _GL_CXXALIAS_RPL (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
  560. # else
  561. # if !0
  562. _GL_FUNCDECL_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr)
  563. __THROW _GL_ARG_NONNULL ((1)));
  564. # endif
  565. _GL_CXXALIAS_SYS (posix_spawnattr_destroy, int, (posix_spawnattr_t *__attr));
  566. # endif
  567. _GL_CXXALIASWARN (posix_spawnattr_destroy);
  568. #elif defined GNULIB_POSIXCHECK
  569. # undef posix_spawnattr_destroy
  570. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY
  571. _GL_WARN_ON_USE (posix_spawnattr_destroy,
  572. "posix_spawnattr_destroy is unportable - "
  573. "use gnulib module posix_spawnattr_destroy for portability");
  574. # endif
  575. #endif
  576. #if 0
  577. /* Store signal mask for signals with default handling from ATTR in
  578. SIGDEFAULT. */
  579. # if 0
  580. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  581. # define posix_spawnattr_getsigdefault rpl_posix_spawnattr_getsigdefault
  582. # endif
  583. _GL_FUNCDECL_RPL (posix_spawnattr_getsigdefault, int,
  584. (const posix_spawnattr_t *_Restrict_ __attr,
  585. sigset_t *_Restrict_ __sigdefault)
  586. __THROW _GL_ARG_NONNULL ((1, 2)));
  587. _GL_CXXALIAS_RPL (posix_spawnattr_getsigdefault, int,
  588. (const posix_spawnattr_t *_Restrict_ __attr,
  589. sigset_t *_Restrict_ __sigdefault));
  590. # else
  591. # if !0
  592. _GL_FUNCDECL_SYS (posix_spawnattr_getsigdefault, int,
  593. (const posix_spawnattr_t *_Restrict_ __attr,
  594. sigset_t *_Restrict_ __sigdefault)
  595. __THROW _GL_ARG_NONNULL ((1, 2)));
  596. # endif
  597. _GL_CXXALIAS_SYS (posix_spawnattr_getsigdefault, int,
  598. (const posix_spawnattr_t *_Restrict_ __attr,
  599. sigset_t *_Restrict_ __sigdefault));
  600. # endif
  601. _GL_CXXALIASWARN (posix_spawnattr_getsigdefault);
  602. #elif defined GNULIB_POSIXCHECK
  603. # undef posix_spawnattr_getsigdefault
  604. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT
  605. _GL_WARN_ON_USE (posix_spawnattr_getsigdefault,
  606. "posix_spawnattr_getsigdefault is unportable - "
  607. "use gnulib module posix_spawnattr_getsigdefault for portability");
  608. # endif
  609. #endif
  610. #if 0
  611. /* Set signal mask for signals with default handling in ATTR to SIGDEFAULT. */
  612. # if 0
  613. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  614. # define posix_spawnattr_setsigdefault rpl_posix_spawnattr_setsigdefault
  615. # endif
  616. _GL_FUNCDECL_RPL (posix_spawnattr_setsigdefault, int,
  617. (posix_spawnattr_t *_Restrict_ __attr,
  618. const sigset_t *_Restrict_ __sigdefault)
  619. __THROW _GL_ARG_NONNULL ((1, 2)));
  620. _GL_CXXALIAS_RPL (posix_spawnattr_setsigdefault, int,
  621. (posix_spawnattr_t *_Restrict_ __attr,
  622. const sigset_t *_Restrict_ __sigdefault));
  623. # else
  624. # if !0
  625. _GL_FUNCDECL_SYS (posix_spawnattr_setsigdefault, int,
  626. (posix_spawnattr_t *_Restrict_ __attr,
  627. const sigset_t *_Restrict_ __sigdefault)
  628. __THROW _GL_ARG_NONNULL ((1, 2)));
  629. # endif
  630. _GL_CXXALIAS_SYS (posix_spawnattr_setsigdefault, int,
  631. (posix_spawnattr_t *_Restrict_ __attr,
  632. const sigset_t *_Restrict_ __sigdefault));
  633. # endif
  634. _GL_CXXALIASWARN (posix_spawnattr_setsigdefault);
  635. #elif defined GNULIB_POSIXCHECK
  636. # undef posix_spawnattr_setsigdefault
  637. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT
  638. _GL_WARN_ON_USE (posix_spawnattr_setsigdefault,
  639. "posix_spawnattr_setsigdefault is unportable - "
  640. "use gnulib module posix_spawnattr_setsigdefault for portability");
  641. # endif
  642. #endif
  643. #if 0
  644. /* Store signal mask for the new process from ATTR in SIGMASK. */
  645. # if 0
  646. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  647. # define posix_spawnattr_getsigmask rpl_posix_spawnattr_getsigmask
  648. # endif
  649. _GL_FUNCDECL_RPL (posix_spawnattr_getsigmask, int,
  650. (const posix_spawnattr_t *_Restrict_ __attr,
  651. sigset_t *_Restrict_ __sigmask)
  652. __THROW _GL_ARG_NONNULL ((1, 2)));
  653. _GL_CXXALIAS_RPL (posix_spawnattr_getsigmask, int,
  654. (const posix_spawnattr_t *_Restrict_ __attr,
  655. sigset_t *_Restrict_ __sigmask));
  656. # else
  657. # if !0
  658. _GL_FUNCDECL_SYS (posix_spawnattr_getsigmask, int,
  659. (const posix_spawnattr_t *_Restrict_ __attr,
  660. sigset_t *_Restrict_ __sigmask)
  661. __THROW _GL_ARG_NONNULL ((1, 2)));
  662. # endif
  663. _GL_CXXALIAS_SYS (posix_spawnattr_getsigmask, int,
  664. (const posix_spawnattr_t *_Restrict_ __attr,
  665. sigset_t *_Restrict_ __sigmask));
  666. # endif
  667. _GL_CXXALIASWARN (posix_spawnattr_getsigmask);
  668. #elif defined GNULIB_POSIXCHECK
  669. # undef posix_spawnattr_getsigmask
  670. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK
  671. _GL_WARN_ON_USE (posix_spawnattr_getsigmask,
  672. "posix_spawnattr_getsigmask is unportable - "
  673. "use gnulib module posix_spawnattr_getsigmask for portability");
  674. # endif
  675. #endif
  676. #if 1
  677. /* Set signal mask for the new process in ATTR to SIGMASK. */
  678. # if 0
  679. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  680. # define posix_spawnattr_setsigmask rpl_posix_spawnattr_setsigmask
  681. # endif
  682. _GL_FUNCDECL_RPL (posix_spawnattr_setsigmask, int,
  683. (posix_spawnattr_t *_Restrict_ __attr,
  684. const sigset_t *_Restrict_ __sigmask)
  685. __THROW _GL_ARG_NONNULL ((1, 2)));
  686. _GL_CXXALIAS_RPL (posix_spawnattr_setsigmask, int,
  687. (posix_spawnattr_t *_Restrict_ __attr,
  688. const sigset_t *_Restrict_ __sigmask));
  689. # else
  690. # if !0
  691. _GL_FUNCDECL_SYS (posix_spawnattr_setsigmask, int,
  692. (posix_spawnattr_t *_Restrict_ __attr,
  693. const sigset_t *_Restrict_ __sigmask)
  694. __THROW _GL_ARG_NONNULL ((1, 2)));
  695. # endif
  696. _GL_CXXALIAS_SYS (posix_spawnattr_setsigmask, int,
  697. (posix_spawnattr_t *_Restrict_ __attr,
  698. const sigset_t *_Restrict_ __sigmask));
  699. # endif
  700. _GL_CXXALIASWARN (posix_spawnattr_setsigmask);
  701. #elif defined GNULIB_POSIXCHECK
  702. # undef posix_spawnattr_setsigmask
  703. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK
  704. _GL_WARN_ON_USE (posix_spawnattr_setsigmask,
  705. "posix_spawnattr_setsigmask is unportable - "
  706. "use gnulib module posix_spawnattr_setsigmask for portability");
  707. # endif
  708. #endif
  709. #if 0
  710. /* Get flag word from the attribute structure. */
  711. # if 0
  712. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  713. # define posix_spawnattr_getflags rpl_posix_spawnattr_getflags
  714. # endif
  715. _GL_FUNCDECL_RPL (posix_spawnattr_getflags, int,
  716. (const posix_spawnattr_t *_Restrict_ __attr,
  717. short int *_Restrict_ __flags)
  718. __THROW _GL_ARG_NONNULL ((1, 2)));
  719. _GL_CXXALIAS_RPL (posix_spawnattr_getflags, int,
  720. (const posix_spawnattr_t *_Restrict_ __attr,
  721. short int *_Restrict_ __flags));
  722. # else
  723. # if !0
  724. _GL_FUNCDECL_SYS (posix_spawnattr_getflags, int,
  725. (const posix_spawnattr_t *_Restrict_ __attr,
  726. short int *_Restrict_ __flags)
  727. __THROW _GL_ARG_NONNULL ((1, 2)));
  728. # endif
  729. _GL_CXXALIAS_SYS (posix_spawnattr_getflags, int,
  730. (const posix_spawnattr_t *_Restrict_ __attr,
  731. short int *_Restrict_ __flags));
  732. # endif
  733. _GL_CXXALIASWARN (posix_spawnattr_getflags);
  734. #elif defined GNULIB_POSIXCHECK
  735. # undef posix_spawnattr_getflags
  736. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS
  737. _GL_WARN_ON_USE (posix_spawnattr_getflags,
  738. "posix_spawnattr_getflags is unportable - "
  739. "use gnulib module posix_spawnattr_getflags for portability");
  740. # endif
  741. #endif
  742. #if 1
  743. /* Store flags in the attribute structure. */
  744. # if 0
  745. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  746. # define posix_spawnattr_setflags rpl_posix_spawnattr_setflags
  747. # endif
  748. _GL_FUNCDECL_RPL (posix_spawnattr_setflags, int,
  749. (posix_spawnattr_t *__attr, short int __flags)
  750. __THROW _GL_ARG_NONNULL ((1)));
  751. _GL_CXXALIAS_RPL (posix_spawnattr_setflags, int,
  752. (posix_spawnattr_t *__attr, short int __flags));
  753. # else
  754. # if !0
  755. _GL_FUNCDECL_SYS (posix_spawnattr_setflags, int,
  756. (posix_spawnattr_t *__attr, short int __flags)
  757. __THROW _GL_ARG_NONNULL ((1)));
  758. # endif
  759. _GL_CXXALIAS_SYS (posix_spawnattr_setflags, int,
  760. (posix_spawnattr_t *__attr, short int __flags));
  761. # endif
  762. _GL_CXXALIASWARN (posix_spawnattr_setflags);
  763. #elif defined GNULIB_POSIXCHECK
  764. # undef posix_spawnattr_setflags
  765. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS
  766. _GL_WARN_ON_USE (posix_spawnattr_setflags,
  767. "posix_spawnattr_setflags is unportable - "
  768. "use gnulib module posix_spawnattr_setflags for portability");
  769. # endif
  770. #endif
  771. #if 0
  772. /* Get process group ID from the attribute structure. */
  773. # if 0
  774. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  775. # define posix_spawnattr_getpgroup rpl_posix_spawnattr_getpgroup
  776. # endif
  777. _GL_FUNCDECL_RPL (posix_spawnattr_getpgroup, int,
  778. (const posix_spawnattr_t *_Restrict_ __attr,
  779. pid_t *_Restrict_ __pgroup)
  780. __THROW _GL_ARG_NONNULL ((1, 2)));
  781. _GL_CXXALIAS_RPL (posix_spawnattr_getpgroup, int,
  782. (const posix_spawnattr_t *_Restrict_ __attr,
  783. pid_t *_Restrict_ __pgroup));
  784. # else
  785. # if !0
  786. _GL_FUNCDECL_SYS (posix_spawnattr_getpgroup, int,
  787. (const posix_spawnattr_t *_Restrict_ __attr,
  788. pid_t *_Restrict_ __pgroup)
  789. __THROW _GL_ARG_NONNULL ((1, 2)));
  790. # endif
  791. _GL_CXXALIAS_SYS (posix_spawnattr_getpgroup, int,
  792. (const posix_spawnattr_t *_Restrict_ __attr,
  793. pid_t *_Restrict_ __pgroup));
  794. # endif
  795. _GL_CXXALIASWARN (posix_spawnattr_getpgroup);
  796. #elif defined GNULIB_POSIXCHECK
  797. # undef posix_spawnattr_getpgroup
  798. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP
  799. _GL_WARN_ON_USE (posix_spawnattr_getpgroup,
  800. "posix_spawnattr_getpgroup is unportable - "
  801. "use gnulib module posix_spawnattr_getpgroup for portability");
  802. # endif
  803. #endif
  804. #if 0
  805. /* Store process group ID in the attribute structure. */
  806. # if 0
  807. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  808. # define posix_spawnattr_setpgroup rpl_posix_spawnattr_setpgroup
  809. # endif
  810. _GL_FUNCDECL_RPL (posix_spawnattr_setpgroup, int,
  811. (posix_spawnattr_t *__attr, pid_t __pgroup)
  812. __THROW _GL_ARG_NONNULL ((1)));
  813. _GL_CXXALIAS_RPL (posix_spawnattr_setpgroup, int,
  814. (posix_spawnattr_t *__attr, pid_t __pgroup));
  815. # else
  816. # if !0
  817. _GL_FUNCDECL_SYS (posix_spawnattr_setpgroup, int,
  818. (posix_spawnattr_t *__attr, pid_t __pgroup)
  819. __THROW _GL_ARG_NONNULL ((1)));
  820. # endif
  821. _GL_CXXALIAS_SYS (posix_spawnattr_setpgroup, int,
  822. (posix_spawnattr_t *__attr, pid_t __pgroup));
  823. # endif
  824. _GL_CXXALIASWARN (posix_spawnattr_setpgroup);
  825. #elif defined GNULIB_POSIXCHECK
  826. # undef posix_spawnattr_setpgroup
  827. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP
  828. _GL_WARN_ON_USE (posix_spawnattr_setpgroup,
  829. "posix_spawnattr_setpgroup is unportable - "
  830. "use gnulib module posix_spawnattr_setpgroup for portability");
  831. # endif
  832. #endif
  833. #if 0
  834. /* Get scheduling policy from the attribute structure. */
  835. # if 0
  836. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  837. # define posix_spawnattr_getschedpolicy rpl_posix_spawnattr_getschedpolicy
  838. # endif
  839. _GL_FUNCDECL_RPL (posix_spawnattr_getschedpolicy, int,
  840. (const posix_spawnattr_t *_Restrict_ __attr,
  841. int *_Restrict_ __schedpolicy)
  842. __THROW _GL_ARG_NONNULL ((1, 2)));
  843. _GL_CXXALIAS_RPL (posix_spawnattr_getschedpolicy, int,
  844. (const posix_spawnattr_t *_Restrict_ __attr,
  845. int *_Restrict_ __schedpolicy));
  846. # else
  847. # if !0 || POSIX_SPAWN_SETSCHEDULER == 0
  848. _GL_FUNCDECL_SYS (posix_spawnattr_getschedpolicy, int,
  849. (const posix_spawnattr_t *_Restrict_ __attr,
  850. int *_Restrict_ __schedpolicy)
  851. __THROW _GL_ARG_NONNULL ((1, 2)));
  852. # endif
  853. _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
  854. (const posix_spawnattr_t *_Restrict_ __attr,
  855. int *_Restrict_ __schedpolicy));
  856. # endif
  857. _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
  858. #elif defined GNULIB_POSIXCHECK
  859. # undef posix_spawnattr_getschedpolicy
  860. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
  861. _GL_WARN_ON_USE (posix_spawnattr_getschedpolicy,
  862. "posix_spawnattr_getschedpolicy is unportable - "
  863. "use gnulib module posix_spawnattr_getschedpolicy for portability");
  864. # endif
  865. #endif
  866. #if 0
  867. /* Store scheduling policy in the attribute structure. */
  868. # if 0
  869. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  870. # define posix_spawnattr_setschedpolicy rpl_posix_spawnattr_setschedpolicy
  871. # endif
  872. _GL_FUNCDECL_RPL (posix_spawnattr_setschedpolicy, int,
  873. (posix_spawnattr_t *__attr, int __schedpolicy)
  874. __THROW _GL_ARG_NONNULL ((1)));
  875. _GL_CXXALIAS_RPL (posix_spawnattr_setschedpolicy, int,
  876. (posix_spawnattr_t *__attr, int __schedpolicy));
  877. # else
  878. # if !0 || POSIX_SPAWN_SETSCHEDULER == 0
  879. _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
  880. (posix_spawnattr_t *__attr, int __schedpolicy)
  881. __THROW _GL_ARG_NONNULL ((1)));
  882. # endif
  883. _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
  884. (posix_spawnattr_t *__attr, int __schedpolicy));
  885. # endif
  886. _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
  887. #elif defined GNULIB_POSIXCHECK
  888. # undef posix_spawnattr_setschedpolicy
  889. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
  890. _GL_WARN_ON_USE (posix_spawnattr_setschedpolicy,
  891. "posix_spawnattr_setschedpolicy is unportable - "
  892. "use gnulib module posix_spawnattr_setschedpolicy for portability");
  893. # endif
  894. #endif
  895. #if 0
  896. /* Get scheduling parameters from the attribute structure. */
  897. # if 0
  898. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  899. # define posix_spawnattr_getschedparam rpl_posix_spawnattr_getschedparam
  900. # endif
  901. _GL_FUNCDECL_RPL (posix_spawnattr_getschedparam, int,
  902. (const posix_spawnattr_t *_Restrict_ __attr,
  903. struct sched_param *_Restrict_ __schedparam)
  904. __THROW _GL_ARG_NONNULL ((1, 2)));
  905. _GL_CXXALIAS_RPL (posix_spawnattr_getschedparam, int,
  906. (const posix_spawnattr_t *_Restrict_ __attr,
  907. struct sched_param *_Restrict_ __schedparam));
  908. # else
  909. # if !0 || POSIX_SPAWN_SETSCHEDPARAM == 0
  910. _GL_FUNCDECL_SYS (posix_spawnattr_getschedparam, int,
  911. (const posix_spawnattr_t *_Restrict_ __attr,
  912. struct sched_param *_Restrict_ __schedparam)
  913. __THROW _GL_ARG_NONNULL ((1, 2)));
  914. # endif
  915. _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
  916. (const posix_spawnattr_t *_Restrict_ __attr,
  917. struct sched_param *_Restrict_ __schedparam));
  918. # endif
  919. _GL_CXXALIASWARN (posix_spawnattr_getschedparam);
  920. #elif defined GNULIB_POSIXCHECK
  921. # undef posix_spawnattr_getschedparam
  922. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
  923. _GL_WARN_ON_USE (posix_spawnattr_getschedparam,
  924. "posix_spawnattr_getschedparam is unportable - "
  925. "use gnulib module posix_spawnattr_getschedparam for portability");
  926. # endif
  927. #endif
  928. #if 0
  929. /* Store scheduling parameters in the attribute structure. */
  930. # if 0
  931. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  932. # define posix_spawnattr_setschedparam rpl_posix_spawnattr_setschedparam
  933. # endif
  934. _GL_FUNCDECL_RPL (posix_spawnattr_setschedparam, int,
  935. (posix_spawnattr_t *_Restrict_ __attr,
  936. const struct sched_param *_Restrict_ __schedparam)
  937. __THROW _GL_ARG_NONNULL ((1, 2)));
  938. _GL_CXXALIAS_RPL (posix_spawnattr_setschedparam, int,
  939. (posix_spawnattr_t *_Restrict_ __attr,
  940. const struct sched_param *_Restrict_ __schedparam));
  941. # else
  942. # if !0 || POSIX_SPAWN_SETSCHEDPARAM == 0
  943. _GL_FUNCDECL_SYS (posix_spawnattr_setschedparam, int,
  944. (posix_spawnattr_t *_Restrict_ __attr,
  945. const struct sched_param *_Restrict_ __schedparam)
  946. __THROW _GL_ARG_NONNULL ((1, 2)));
  947. # endif
  948. _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
  949. (posix_spawnattr_t *_Restrict_ __attr,
  950. const struct sched_param *_Restrict_ __schedparam));
  951. # endif
  952. _GL_CXXALIASWARN (posix_spawnattr_setschedparam);
  953. #elif defined GNULIB_POSIXCHECK
  954. # undef posix_spawnattr_setschedparam
  955. # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
  956. _GL_WARN_ON_USE (posix_spawnattr_setschedparam,
  957. "posix_spawnattr_setschedparam is unportable - "
  958. "use gnulib module posix_spawnattr_setschedparam for portability");
  959. # endif
  960. #endif
  961. #if 1
  962. /* Initialize data structure for file attribute for 'spawn' call. */
  963. # if 0
  964. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  965. # define posix_spawn_file_actions_init rpl_posix_spawn_file_actions_init
  966. # endif
  967. _GL_FUNCDECL_RPL (posix_spawn_file_actions_init, int,
  968. (posix_spawn_file_actions_t *__file_actions)
  969. __THROW _GL_ARG_NONNULL ((1)));
  970. _GL_CXXALIAS_RPL (posix_spawn_file_actions_init, int,
  971. (posix_spawn_file_actions_t *__file_actions));
  972. # else
  973. # if !0
  974. _GL_FUNCDECL_SYS (posix_spawn_file_actions_init, int,
  975. (posix_spawn_file_actions_t *__file_actions)
  976. __THROW _GL_ARG_NONNULL ((1)));
  977. # endif
  978. _GL_CXXALIAS_SYS (posix_spawn_file_actions_init, int,
  979. (posix_spawn_file_actions_t *__file_actions));
  980. # endif
  981. _GL_CXXALIASWARN (posix_spawn_file_actions_init);
  982. #elif defined GNULIB_POSIXCHECK
  983. # undef posix_spawn_file_actions_init
  984. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT
  985. _GL_WARN_ON_USE (posix_spawn_file_actions_init,
  986. "posix_spawn_file_actions_init is unportable - "
  987. "use gnulib module posix_spawn_file_actions_init for portability");
  988. # endif
  989. #endif
  990. #if 1
  991. /* Free resources associated with FILE-ACTIONS. */
  992. # if 0
  993. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  994. # define posix_spawn_file_actions_destroy rpl_posix_spawn_file_actions_destroy
  995. # endif
  996. _GL_FUNCDECL_RPL (posix_spawn_file_actions_destroy, int,
  997. (posix_spawn_file_actions_t *__file_actions)
  998. __THROW _GL_ARG_NONNULL ((1)));
  999. _GL_CXXALIAS_RPL (posix_spawn_file_actions_destroy, int,
  1000. (posix_spawn_file_actions_t *__file_actions));
  1001. # else
  1002. # if !0
  1003. _GL_FUNCDECL_SYS (posix_spawn_file_actions_destroy, int,
  1004. (posix_spawn_file_actions_t *__file_actions)
  1005. __THROW _GL_ARG_NONNULL ((1)));
  1006. # endif
  1007. _GL_CXXALIAS_SYS (posix_spawn_file_actions_destroy, int,
  1008. (posix_spawn_file_actions_t *__file_actions));
  1009. # endif
  1010. _GL_CXXALIASWARN (posix_spawn_file_actions_destroy);
  1011. #elif defined GNULIB_POSIXCHECK
  1012. # undef posix_spawn_file_actions_destroy
  1013. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY
  1014. _GL_WARN_ON_USE (posix_spawn_file_actions_destroy,
  1015. "posix_spawn_file_actions_destroy is unportable - "
  1016. "use gnulib module posix_spawn_file_actions_destroy for portability");
  1017. # endif
  1018. #endif
  1019. #if 1
  1020. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1021. 'open' for the given file during the 'spawn' call. */
  1022. # if 1
  1023. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1024. # define posix_spawn_file_actions_addopen rpl_posix_spawn_file_actions_addopen
  1025. # endif
  1026. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addopen, int,
  1027. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1028. int __fd,
  1029. const char *_Restrict_ __path, int __oflag, mode_t __mode)
  1030. __THROW _GL_ARG_NONNULL ((1, 3)));
  1031. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addopen, int,
  1032. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1033. int __fd,
  1034. const char *_Restrict_ __path, int __oflag, mode_t __mode));
  1035. # else
  1036. # if !0
  1037. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addopen, int,
  1038. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1039. int __fd,
  1040. const char *_Restrict_ __path, int __oflag, mode_t __mode)
  1041. __THROW _GL_ARG_NONNULL ((1, 3)));
  1042. # endif
  1043. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int,
  1044. (posix_spawn_file_actions_t *_Restrict_ __file_actions,
  1045. int __fd,
  1046. const char *_Restrict_ __path, int __oflag, mode_t __mode));
  1047. # endif
  1048. _GL_CXXALIASWARN (posix_spawn_file_actions_addopen);
  1049. #elif defined GNULIB_POSIXCHECK
  1050. # undef posix_spawn_file_actions_addopen
  1051. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
  1052. _GL_WARN_ON_USE (posix_spawn_file_actions_addopen,
  1053. "posix_spawn_file_actions_addopen is unportable - "
  1054. "use gnulib module posix_spawn_file_actions_addopen for portability");
  1055. # endif
  1056. #endif
  1057. #if 1
  1058. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1059. 'close' for the given file descriptor during the 'spawn' call. */
  1060. # if 1
  1061. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1062. # define posix_spawn_file_actions_addclose rpl_posix_spawn_file_actions_addclose
  1063. # endif
  1064. _GL_FUNCDECL_RPL (posix_spawn_file_actions_addclose, int,
  1065. (posix_spawn_file_actions_t *__file_actions, int __fd)
  1066. __THROW _GL_ARG_NONNULL ((1)));
  1067. _GL_CXXALIAS_RPL (posix_spawn_file_actions_addclose, int,
  1068. (posix_spawn_file_actions_t *__file_actions, int __fd));
  1069. # else
  1070. # if !0
  1071. _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int,
  1072. (posix_spawn_file_actions_t *__file_actions, int __fd)
  1073. __THROW _GL_ARG_NONNULL ((1)));
  1074. # endif
  1075. _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int,
  1076. (posix_spawn_file_actions_t *__file_actions, int __fd));
  1077. # endif
  1078. _GL_CXXALIASWARN (posix_spawn_file_actions_addclose);
  1079. #elif defined GNULIB_POSIXCHECK
  1080. # undef posix_spawn_file_actions_addclose
  1081. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
  1082. _GL_WARN_ON_USE (posix_spawn_file_actions_addclose,
  1083. "posix_spawn_file_actions_addclose is unportable - "
  1084. "use gnulib module posix_spawn_file_actions_addclose for portability");
  1085. # endif
  1086. #endif
  1087. #if 1
  1088. /* Add an action to FILE-ACTIONS which tells the implementation to call
  1089. 'dup2' for the given file descriptors during the 'spawn' call. */
  1090. # if 1
  1091. # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
  1092. # define posix_spawn_file_actions_adddup2 rpl_posix_spawn_file_actions_adddup2
  1093. # endif
  1094. _GL_FUNCDECL_RPL (posix_spawn_file_actions_adddup2, int,
  1095. (posix_spawn_file_actions_t *__file_actions,
  1096. int __fd, int __newfd)
  1097. __THROW _GL_ARG_NONNULL ((1)));
  1098. _GL_CXXALIAS_RPL (posix_spawn_file_actions_adddup2, int,
  1099. (posix_spawn_file_actions_t *__file_actions,
  1100. int __fd, int __newfd));
  1101. # else
  1102. # if !0
  1103. _GL_FUNCDECL_SYS (posix_spawn_file_actions_adddup2, int,
  1104. (posix_spawn_file_actions_t *__file_actions,
  1105. int __fd, int __newfd)
  1106. __THROW _GL_ARG_NONNULL ((1)));
  1107. # endif
  1108. _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int,
  1109. (posix_spawn_file_actions_t *__file_actions,
  1110. int __fd, int __newfd));
  1111. # endif
  1112. _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2);
  1113. #elif defined GNULIB_POSIXCHECK
  1114. # undef posix_spawn_file_actions_adddup2
  1115. # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
  1116. _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2,
  1117. "posix_spawn_file_actions_adddup2 is unportable - "
  1118. "use gnulib module posix_spawn_file_actions_adddup2 for portability");
  1119. # endif
  1120. #endif
  1121. #endif /* _GL_M4_SPAWN_H */
  1122. #endif /* _GL_M4_SPAWN_H */