logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

getconf_vars.m4 (15338B)


  1. dnl utils-std: Collection of commonly available Unix tools
  2. dnl SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. dnl SPDX-License-Identifier: MPL-2.0
  4. dnl
  5. dnl Usage: m4 cmd/getconf_vars.m4 > cmd/getconf_vars.h
  6. dnl
  7. define(`conf_var', `#ifdef $2
  8. {$1, $2, -1},
  9. #else
  10. #warning conf variable name $2 undefined
  11. #endif
  12. ')dnl
  13. define(`conf_var_limit', `#ifndef $3
  14. #define $3 -1
  15. #endif
  16. #ifdef $2
  17. {$1, $2, $3},
  18. #else
  19. #warning conf variable name $2 undefined
  20. #endif
  21. ')dnl
  22. struct conf_vars
  23. {
  24. const char *name;
  25. const int value;
  26. const long limit_h;
  27. };
  28. struct limits
  29. {
  30. const char *name;
  31. const long limit_h;
  32. };
  33. dnl _CS_V${n}_ENV exposes environment variables to achieve said SUSv${n} version
  34. dnl It's therefore dependent on what the underlying system supports.
  35. define(`confstr_var', `#ifdef _CS_$1
  36. {"$1", _CS_$1, -1},
  37. #endif')dnl
  38. // confstr(3) variables without the _CS_ prefix
  39. static const struct conf_vars confstr_vars[] = {
  40. conf_var("PATH", _CS_PATH)
  41. confstr_var(POSIX_V8_ILP32_OFF32_CFLAGS)
  42. confstr_var(POSIX_V8_ILP32_OFF32_LDFLAGS)
  43. confstr_var(POSIX_V8_ILP32_OFF32_LIBS)
  44. confstr_var(POSIX_V8_ILP32_OFFBIG_CFLAGS)
  45. confstr_var(POSIX_V8_ILP32_OFFBIG_LDFLAGS)
  46. confstr_var(POSIX_V8_ILP32_OFFBIG_LIBS)
  47. confstr_var(POSIX_V8_LP64_OFF64_CFLAGS)
  48. confstr_var(POSIX_V8_LP64_OFF64_LDFLAGS)
  49. confstr_var(POSIX_V8_LP64_OFF64_LIBS)
  50. confstr_var(POSIX_V8_LPBIG_OFFBIG_CFLAGS)
  51. confstr_var(POSIX_V8_LPBIG_OFFBIG_LDFLAGS)
  52. confstr_var(POSIX_V8_LPBIG_OFFBIG_LIBS)
  53. confstr_var(POSIX_V8_THREADS_CFLAGS)
  54. confstr_var(POSIX_V8_THREADS_LDFLAGS)
  55. confstr_var(POSIX_V8_WIDTH_RESTRICTED_ENVS)
  56. confstr_var(V8_ENV)
  57. confstr_var(POSIX_V7_ILP32_OFF32_CFLAGS)
  58. confstr_var(POSIX_V7_ILP32_OFF32_LDFLAGS)
  59. confstr_var(POSIX_V7_ILP32_OFF32_LIBS)
  60. confstr_var(POSIX_V7_ILP32_OFFBIG_CFLAGS)
  61. confstr_var(POSIX_V7_ILP32_OFFBIG_LDFLAGS)
  62. confstr_var(POSIX_V7_ILP32_OFFBIG_LIBS)
  63. confstr_var(POSIX_V7_LP64_OFF64_CFLAGS)
  64. confstr_var(POSIX_V7_LP64_OFF64_LDFLAGS)
  65. confstr_var(POSIX_V7_LP64_OFF64_LIBS)
  66. confstr_var(POSIX_V7_LPBIG_OFFBIG_CFLAGS)
  67. confstr_var(POSIX_V7_LPBIG_OFFBIG_LDFLAGS)
  68. confstr_var(POSIX_V7_LPBIG_OFFBIG_LIBS)
  69. confstr_var(POSIX_V7_THREADS_CFLAGS)
  70. confstr_var(POSIX_V7_THREADS_LDFLAGS)
  71. confstr_var(POSIX_V7_WIDTH_RESTRICTED_ENVS)
  72. confstr_var(V7_ENV)
  73. confstr_var(POSIX_V6_ILP32_OFF32_CFLAGS)
  74. confstr_var(POSIX_V6_ILP32_OFF32_LDFLAGS)
  75. confstr_var(POSIX_V6_ILP32_OFF32_LIBS)
  76. confstr_var(POSIX_V6_ILP32_OFFBIG_CFLAGS)
  77. confstr_var(POSIX_V6_ILP32_OFFBIG_LDFLAGS)
  78. confstr_var(POSIX_V6_ILP32_OFFBIG_LIBS)
  79. confstr_var(POSIX_V6_LP64_OFF64_CFLAGS)
  80. confstr_var(POSIX_V6_LP64_OFF64_LDFLAGS)
  81. confstr_var(POSIX_V6_LP64_OFF64_LIBS)
  82. confstr_var(POSIX_V6_LPBIG_OFFBIG_CFLAGS)
  83. confstr_var(POSIX_V6_LPBIG_OFFBIG_LDFLAGS)
  84. confstr_var(POSIX_V6_LPBIG_OFFBIG_LIBS)
  85. confstr_var(POSIX_V6_WIDTH_RESTRICTED_ENVS)
  86. confstr_var(V6_ENV)
  87. };
  88. static const struct conf_vars pathconf_vars[] = {
  89. conf_var_limit("FILESIZEBITS", _PC_FILESIZEBITS, FILESIZEBITS)
  90. conf_var_limit("LINK_MAX", _PC_LINK_MAX, LINK_MAX)
  91. conf_var_limit("MAX_CANON", _PC_MAX_CANON, MAX_CANON)
  92. conf_var_limit("MAX_INPUT", _PC_MAX_INPUT, MAX_INPUT)
  93. conf_var_limit("NAME_MAX", _PC_NAME_MAX, NAME_MAX)
  94. conf_var_limit("PATH_MAX", _PC_PATH_MAX, PATH_MAX)
  95. conf_var_limit("PIPE_BUF", _PC_PIPE_BUF, PIPE_BUF)
  96. conf_var_limit("POSIX2_SYMLINKS", _PC_2_SYMLINKS, POSIX2_SYMLINKS)
  97. conf_var_limit("POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN, POSIX_ALLOC_SIZE_MIN)
  98. conf_var_limit("POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE, POSIX_REC_INCR_XFER_SIZE)
  99. conf_var_limit("POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE, POSIX_REC_MAX_XFER_SIZE)
  100. conf_var_limit("POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE, POSIX_REC_MIN_XFER_SIZE)
  101. conf_var_limit("POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN, POSIX_REC_XFER_ALIGN)
  102. conf_var_limit("SYMLINK_MAX", _PC_SYMLINK_MAX, SYMLINK_MAX)
  103. conf_var_limit("TEXTDOMAIN_MAX", _PC_TEXTDOMAIN_MAX, TEXTDOMAIN_MAX)
  104. conf_var("_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED)
  105. conf_var("_POSIX_NO_TRUNC", _PC_NO_TRUNC)
  106. conf_var("_POSIX_VDISABLE", _PC_VDISABLE)
  107. conf_var("_POSIX_ASYNC_IO", _PC_ASYNC_IO)
  108. conf_var("_POSIX_FALLOC", _PC_FALLOC)
  109. conf_var("_POSIX_PRIO_IO", _PC_PRIO_IO)
  110. conf_var("_POSIX_SYNC_IO", _PC_SYNC_IO)
  111. conf_var("_POSIX_TIMESTAMP_RESOLUTION", _PC_TIMESTAMP_RESOLUTION)
  112. };
  113. static const struct conf_vars sysconf_vars[] = {
  114. conf_var_limit("AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX, AIO_LISTIO_MAX)
  115. conf_var_limit("AIO_MAX", _SC_AIO_MAX, AIO_MAX)
  116. conf_var_limit("AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX, AIO_PRIO_DELTA_MAX)
  117. conf_var_limit("ARG_MAX", _SC_ARG_MAX, ARG_MAX)
  118. conf_var_limit("ATEXIT_MAX", _SC_ATEXIT_MAX, ATEXIT_MAX)
  119. conf_var_limit("BC_BASE_MAX", _SC_BC_BASE_MAX, BC_BASE_MAX)
  120. conf_var_limit("BC_DIM_MAX", _SC_BC_DIM_MAX, BC_DIM_MAX)
  121. conf_var_limit("BC_SCALE_MAX", _SC_BC_SCALE_MAX, BC_SCALE_MAX)
  122. conf_var_limit("BC_STRING_MAX", _SC_BC_STRING_MAX, BC_STRING_MAX)
  123. conf_var_limit("CHILD_MAX", _SC_CHILD_MAX, CHILD_MAX)
  124. // name not in POSIX.1-2024 but _SC_ value is
  125. conf_var("CLK_TCK", _SC_CLK_TCK)
  126. conf_var_limit("COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX, COLL_WEIGHTS_MAX)
  127. conf_var_limit("DELAYTIMER_MAX", _SC_DELAYTIMER_MAX, DELAYTIMER_MAX)
  128. conf_var_limit("EXPR_NEST_MAX", _SC_EXPR_NEST_MAX, EXPR_NEST_MAX)
  129. conf_var_limit("HOST_NAME_MAX", _SC_HOST_NAME_MAX, HOST_NAME_MAX)
  130. conf_var_limit("IOV_MAX", _SC_IOV_MAX, IOV_MAX)
  131. conf_var_limit("LINE_MAX", _SC_LINE_MAX, LINE_MAX)
  132. conf_var_limit("LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX, LOGIN_NAME_MAX)
  133. conf_var_limit("NGROUPS_MAX", _SC_NGROUPS_MAX, NGROUPS_MAX)
  134. // name not in POSIX.1-2024 but _SC_ value is
  135. conf_var("GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX)
  136. // name not in POSIX.1-2024 but _SC_ value is
  137. conf_var("GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX)
  138. conf_var_limit("MQ_OPEN_MAX", _SC_MQ_OPEN_MAX, MQ_OPEN_MAX)
  139. conf_var_limit("MQ_PRIO_MAX", _SC_MQ_PRIO_MAX, MQ_PRIO_MAX)
  140. // added in POSIX.1-2024
  141. // name not in POSIX.1-2024 but _SC_ value is
  142. conf_var("NPROCESSORS_CONF", _SC_NPROCESSORS_CONF)
  143. // added in POSIX.1-2024
  144. // name not in POSIX.1-2024 but _SC_ value is
  145. conf_var("NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN)
  146. // added in POSIX.1-2024
  147. // name not in POSIX.1-2024 but _SC_ value is
  148. conf_var_limit("NSIG", _SC_NSIG, NSIG)
  149. conf_var_limit("OPEN_MAX", _SC_OPEN_MAX, OPEN_MAX)
  150. conf_var_limit("PAGE_SIZE", _SC_PAGE_SIZE, PAGE_SIZE)
  151. conf_var_limit("PAGESIZE", _SC_PAGESIZE, PAGESIZE)
  152. conf_var_limit("PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS, PTHREAD_DESTRUCTOR_ITERATIONS)
  153. conf_var_limit("PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX, PTHREAD_KEYS_MAX)
  154. conf_var_limit("PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN, PTHREAD_STACK_MIN)
  155. conf_var_limit("PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX, PTHREAD_THREADS_MAX)
  156. conf_var_limit("RE_DUP_MAX", _SC_RE_DUP_MAX, RE_DUP_MAX)
  157. conf_var_limit("RTSIG_MAX", _SC_RTSIG_MAX, RTSIG_MAX)
  158. conf_var_limit("SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX, SEM_NSEMS_MAX)
  159. conf_var_limit("SEM_VALUE_MAX", _SC_SEM_VALUE_MAX, SEM_VALUE_MAX)
  160. conf_var_limit("SIGQUEUE_MAX", _SC_SIGQUEUE_MAX, SIGQUEUE_MAX)
  161. conf_var_limit("STREAM_MAX", _SC_STREAM_MAX, STREAM_MAX)
  162. conf_var_limit("SYMLOOP_MAX", _SC_SYMLOOP_MAX, SYMLOOP_MAX)
  163. conf_var_limit("TIMER_MAX", _SC_TIMER_MAX, TIMER_MAX)
  164. conf_var_limit("TTY_NAME_MAX", _SC_TTY_NAME_MAX, TTY_NAME_MAX)
  165. conf_var_limit("TZNAME_MAX", _SC_TZNAME_MAX, TZNAME_MAX)
  166. conf_var("_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO)
  167. conf_var("_POSIX_BARRIERS", _SC_BARRIERS)
  168. conf_var("_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO)
  169. conf_var("_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION)
  170. conf_var("_POSIX_CPUTIME", _SC_CPUTIME)
  171. // added in POSIX.1-2024
  172. conf_var("_POSIX_DEVICE_CONTROL", _SC_DEVICE_CONTROL)
  173. conf_var("_POSIX_FSYNC", _SC_FSYNC)
  174. conf_var("_POSIX_IPV6", _SC_IPV6)
  175. conf_var("_POSIX_JOB_CONTROL", _SC_JOB_CONTROL)
  176. conf_var("_POSIX_MAPPED_FILES", _SC_MAPPED_FILES)
  177. conf_var("_POSIX_MEMLOCK", _SC_MEMLOCK)
  178. conf_var("_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE)
  179. conf_var("_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION)
  180. conf_var("_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING)
  181. conf_var("_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK)
  182. conf_var("_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO)
  183. conf_var("_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING)
  184. conf_var("_POSIX_RAW_SOCKETS", _SC_RAW_SOCKETS)
  185. conf_var("_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS)
  186. conf_var("_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS)
  187. conf_var("_POSIX_REGEXP", _SC_REGEXP)
  188. conf_var("_POSIX_SAVED_IDS", _SC_SAVED_IDS)
  189. conf_var("_POSIX_SEMAPHORES", _SC_SEMAPHORES)
  190. conf_var("_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS)
  191. conf_var("_POSIX_SHELL", _SC_SHELL)
  192. conf_var("_POSIX_SPAWN", _SC_SPAWN)
  193. conf_var("_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS)
  194. conf_var("_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER)
  195. conf_var("_POSIX_SS_REPL_MAX", _SC_SS_REPL_MAX)
  196. conf_var("_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO)
  197. conf_var("_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR)
  198. conf_var("_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE)
  199. conf_var("_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME)
  200. conf_var("_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT)
  201. conf_var("_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT)
  202. conf_var("_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING)
  203. conf_var("_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED)
  204. conf_var("_POSIX_THREAD_ROBUST_PRIO_INHERIT", _SC_THREAD_ROBUST_PRIO_INHERIT)
  205. conf_var("_POSIX_THREAD_ROBUST_PRIO_PROTECT", _SC_THREAD_ROBUST_PRIO_PROTECT)
  206. conf_var("_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS)
  207. conf_var("_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER)
  208. conf_var("_POSIX_THREADS", _SC_THREADS)
  209. conf_var("_POSIX_TIMEOUTS", _SC_TIMEOUTS)
  210. conf_var("_POSIX_TIMERS", _SC_TIMERS)
  211. conf_var("_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS)
  212. conf_var("_POSIX_VERSION", _SC_VERSION)
  213. // added in POSIX.1-2024
  214. conf_var("_POSIX_V8_ILP32_OFF32", _SC_V8_ILP32_OFF32)
  215. // added in POSIX.1-2024
  216. conf_var("_POSIX_V8_ILP32_OFFBIG", _SC_V8_ILP32_OFFBIG)
  217. // added in POSIX.1-2024
  218. conf_var("_POSIX_V8_LP64_OFF64", _SC_V8_LP64_OFF64)
  219. // added in POSIX.1-2024
  220. conf_var("_POSIX_V8_LPBIG_OFFBIG", _SC_V8_LPBIG_OFFBIG)
  221. // Obsolescent in POSIX.1-2024
  222. conf_var("_POSIX_V7_ILP32_OFF32", _SC_V7_ILP32_OFF32)
  223. conf_var("_POSIX_V7_ILP32_OFFBIG", _SC_V7_ILP32_OFFBIG)
  224. conf_var("_POSIX_V7_LP64_OFF64", _SC_V7_LP64_OFF64)
  225. conf_var("_POSIX_V7_LPBIG_OFFBIG", _SC_V7_LPBIG_OFFBIG)
  226. // For compatibility with earlier versions, the following variable names shall also be supported: POSIX2_C_BIND POSIX2_C_DEV POSIX2_CHAR_TERM POSIX2_FORT_RUN POSIX2_LOCALEDEF POSIX2_SW_DEV POSIX2_UPE POSIX2_VERSION
  227. conf_var("POSIX2_C_BIND", _SC_2_C_BIND)
  228. conf_var("_POSIX2_C_BIND", _SC_2_C_BIND)
  229. conf_var("POSIX2_C_DEV", _SC_2_C_DEV)
  230. conf_var("_POSIX2_C_DEV", _SC_2_C_DEV)
  231. conf_var("POSIX2_CHAR_TERM", _SC_2_CHAR_TERM)
  232. conf_var("_POSIX2_CHAR_TERM", _SC_2_CHAR_TERM)
  233. conf_var("POSIX2_FORT_RUN", _SC_2_FORT_RUN)
  234. conf_var("_POSIX2_FORT_RUN", _SC_2_FORT_RUN)
  235. conf_var("POSIX2_LOCALEDEF", _SC_2_LOCALEDEF)
  236. conf_var("_POSIX2_LOCALEDEF", _SC_2_LOCALEDEF)
  237. conf_var("POSIX2_SW_DEV", _SC_2_SW_DEV)
  238. conf_var("_POSIX2_SW_DEV", _SC_2_SW_DEV)
  239. conf_var("POSIX2_UPE", _SC_2_UPE)
  240. conf_var("_POSIX2_UPE", _SC_2_UPE)
  241. conf_var("POSIX2_VERSION", _SC_2_VERSION)
  242. conf_var("_POSIX2_VERSION", _SC_2_VERSION)
  243. conf_var("_XOPEN_CRYPT", _SC_XOPEN_CRYPT)
  244. conf_var("_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N)
  245. conf_var("_XOPEN_REALTIME", _SC_XOPEN_REALTIME)
  246. conf_var("_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS)
  247. conf_var("_XOPEN_SHM", _SC_XOPEN_SHM)
  248. conf_var("_XOPEN_UNIX", _SC_XOPEN_UNIX)
  249. conf_var("XOPEN_UNIX", _SC_XOPEN_UNIX)
  250. // added in POSIX.1-2008, strangely missing from musl
  251. conf_var("_XOPEN_UUCP", _SC_XOPEN_UUCP)
  252. conf_var("XOPEN_UUCP", _SC_XOPEN_UUCP)
  253. conf_var("_XOPEN_VERSION", _SC_XOPEN_VERSION)
  254. #ifdef _SC_CHARCLASS_NAME_MAX
  255. /* https://www.austingroupbugs.net/view.php?id=1912 - sysconf lacks variable for {CHARCLASS_NAME_MAX} */
  256. conf_var_limit("CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX, CHARCLASS_NAME_MAX)
  257. #endif
  258. };
  259. define(`limits_var', `#ifdef $1
  260. {"$1", $1},
  261. #else
  262. #warning limits.h variable $1 undefined
  263. #endif
  264. ')dnl
  265. define(`limits_var_alias', ` {"$1", $2},')dnl
  266. // _MIN and _MAX from <limits.h>
  267. static const struct limits limits_vars[] = {
  268. limits_var(SS_REPL_MAX)
  269. #ifndef _SC_CHARCLASS_NAME_MAX
  270. limits_var(CHARCLASS_NAME_MAX)
  271. #endif
  272. limits_var(_POSIX_CLOCKRES_MIN)
  273. limits_var(_POSIX_AIO_LISTIO_MAX)
  274. limits_var(_POSIX_AIO_MAX)
  275. limits_var(_POSIX_ARG_MAX)
  276. limits_var(_POSIX_CHILD_MAX)
  277. limits_var(_POSIX_DELAYTIMER_MAX)
  278. limits_var(_POSIX_HOST_NAME_MAX)
  279. limits_var(_POSIX_LINK_MAX)
  280. limits_var(_POSIX_LOGIN_NAME_MAX)
  281. limits_var(_POSIX_MAX_CANON)
  282. limits_var(_POSIX_MAX_INPUT)
  283. limits_var(_POSIX_MQ_OPEN_MAX)
  284. limits_var(_POSIX_MQ_PRIO_MAX)
  285. limits_var(_POSIX_NAME_MAX)
  286. limits_var(_POSIX_NGROUPS_MAX)
  287. limits_var(_POSIX_OPEN_MAX)
  288. limits_var(_POSIX_PATH_MAX)
  289. limits_var(_POSIX_PIPE_BUF)
  290. limits_var(_POSIX_RE_DUP_MAX)
  291. limits_var(_POSIX_RTSIG_MAX)
  292. limits_var(_POSIX_SEM_NSEMS_MAX)
  293. limits_var(_POSIX_SEM_VALUE_MAX)
  294. limits_var(_POSIX_SIGQUEUE_MAX)
  295. limits_var(_POSIX_SSIZE_MAX)
  296. limits_var(_POSIX_SS_REPL_MAX)
  297. limits_var(_POSIX_STREAM_MAX)
  298. limits_var(_POSIX_SYMLINK_MAX)
  299. limits_var(_POSIX_SYMLOOP_MAX)
  300. limits_var(_POSIX_THREAD_DESTRUCTOR_ITERATIONS)
  301. limits_var(_POSIX_THREAD_KEYS_MAX)
  302. limits_var(_POSIX_THREAD_THREADS_MAX)
  303. limits_var(_POSIX_TIMER_MAX)
  304. limits_var(_POSIX_TTY_NAME_MAX)
  305. limits_var(_POSIX_TZNAME_MAX)
  306. limits_var(_POSIX2_BC_BASE_MAX)
  307. limits_var(_POSIX2_BC_DIM_MAX)
  308. limits_var(_POSIX2_BC_SCALE_MAX)
  309. limits_var(_POSIX2_BC_STRING_MAX)
  310. limits_var(_POSIX2_CHARCLASS_NAME_MAX)
  311. limits_var(_POSIX2_COLL_WEIGHTS_MAX)
  312. limits_var(_POSIX2_EXPR_NEST_MAX)
  313. limits_var(_POSIX2_LINE_MAX)
  314. limits_var(_POSIX2_RE_DUP_MAX)
  315. #ifndef __GLIBC__
  316. /*
  317. * As observed on glibc 2.41, _XOPEN_IOV_MAX gets defined to _POSIX_UIO_MAXIOV
  318. * which ironically doesn't gets defined in a post-Y2K POSIX namespace
  319. * <https://sourceware.org/bugzilla/show_bug.cgi?id=17515>
  320. */
  321. limits_var(_XOPEN_IOV_MAX)
  322. #endif
  323. limits_var(_XOPEN_NAME_MAX)
  324. limits_var(_XOPEN_PATH_MAX)
  325. limits_var(CHAR_BIT)
  326. limits_var(CHAR_MAX)
  327. limits_var(CHAR_MIN)
  328. limits_var(INT_MAX)
  329. limits_var(INT_MIN)
  330. limits_var(LLONG_MAX)
  331. limits_var(LLONG_MIN)
  332. limits_var(LONG_BIT)
  333. limits_var(LONG_MAX)
  334. limits_var(LONG_MIN)
  335. limits_var(MB_LEN_MAX)
  336. limits_var(SCHAR_MAX)
  337. limits_var(SCHAR_MIN)
  338. limits_var(SHRT_MAX)
  339. limits_var(SHRT_MIN)
  340. limits_var(SSIZE_MAX)
  341. limits_var(UCHAR_MAX)
  342. limits_var(UINT_MAX)
  343. limits_var(ULLONG_MAX)
  344. limits_var(ULONG_MAX)
  345. limits_var(USHRT_MAX)
  346. limits_var(WORD_BIT)
  347. limits_var(GETENTROPY_MAX)
  348. limits_var(NL_ARGMAX)
  349. limits_var(NL_LANGMAX)
  350. limits_var(NL_MSGMAX)
  351. limits_var(NL_SETMAX)
  352. limits_var(NL_TEXTMAX)
  353. limits_var(NSIG_MAX)
  354. limits_var(NZERO)
  355. // For compatibility with earlier versions, the following variable names shall also be supported: POSIX2_BC_BASE_MAX POSIX2_BC_DIM_MAX POSIX2_BC_SCALE_MAX POSIX2_BC_STRING_MAX POSIX2_COLL_WEIGHTS_MAX POSIX2_EXPR_NEST_MAX POSIX2_LINE_MAX POSIX2_RE_DUP_MAX
  356. limits_var_alias(POSIX2_BC_BASE_MAX, _POSIX2_BC_BASE_MAX)
  357. limits_var_alias(POSIX2_BC_DIM_MAX, _POSIX2_BC_DIM_MAX)
  358. limits_var_alias(POSIX2_BC_SCALE_MAX, _POSIX2_BC_SCALE_MAX)
  359. limits_var_alias(POSIX2_BC_STRING_MAX, _POSIX2_BC_STRING_MAX)
  360. limits_var_alias(POSIX2_COLL_WEIGHTS_MAX, _POSIX2_COLL_WEIGHTS_MAX)
  361. limits_var_alias(POSIX2_EXPR_NEST_MAX, _POSIX2_EXPR_NEST_MAX)
  362. limits_var_alias(POSIX2_LINE_MAX, _POSIX2_LINE_MAX)
  363. limits_var_alias(POSIX2_RE_DUP_MAX, _POSIX2_RE_DUP_MAX)
  364. };