1 /* Copyright (C) 1991, 92, 1995-2004, 2005 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library 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 GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 #include "../version.h"
29 #define PACKAGE _libc_intl_domainname
35 const enum { SYSCONF
, CONFSTR
, PATHCONF
} call
;
38 static const struct conf vars
[] =
41 { "LINK_MAX", _PC_LINK_MAX
, PATHCONF
},
44 { "_POSIX_LINK_MAX", _PC_LINK_MAX
, PATHCONF
},
47 { "MAX_CANON", _PC_MAX_CANON
, PATHCONF
},
50 { "_POSIX_MAX_CANON", _PC_MAX_CANON
, PATHCONF
},
53 { "MAX_INPUT", _PC_MAX_INPUT
, PATHCONF
},
56 { "_POSIX_MAX_INPUT", _PC_MAX_INPUT
, PATHCONF
},
59 { "NAME_MAX", _PC_NAME_MAX
, PATHCONF
},
62 { "_POSIX_NAME_MAX", _PC_NAME_MAX
, PATHCONF
},
65 { "PATH_MAX", _PC_PATH_MAX
, PATHCONF
},
68 { "_POSIX_PATH_MAX", _PC_PATH_MAX
, PATHCONF
},
71 { "PIPE_BUF", _PC_PIPE_BUF
, PATHCONF
},
74 { "_POSIX_PIPE_BUF", _PC_PIPE_BUF
, PATHCONF
},
76 #ifdef _PC_SOCK_MAXBUF
77 { "SOCK_MAXBUF", _PC_SOCK_MAXBUF
, PATHCONF
},
80 { "_POSIX_ASYNC_IO", _PC_ASYNC_IO
, PATHCONF
},
82 #ifdef _PC_CHOWN_RESTRICTED
83 { "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED
, PATHCONF
},
86 { "_POSIX_NO_TRUNC", _PC_NO_TRUNC
, PATHCONF
},
89 { "_POSIX_PRIO_IO", _PC_PRIO_IO
, PATHCONF
},
92 { "_POSIX_SYNC_IO", _PC_SYNC_IO
, PATHCONF
},
95 { "_POSIX_VDISABLE", _PC_VDISABLE
, PATHCONF
},
99 { "ARG_MAX", _SC_ARG_MAX
, SYSCONF
},
101 #ifdef _SC_ATEXIT_MAX
102 { "ATEXIT_MAX", _SC_ATEXIT_MAX
, SYSCONF
},
105 { "CHAR_BIT", _SC_CHAR_BIT
, SYSCONF
},
108 { "CHAR_MAX", _SC_CHAR_MAX
, SYSCONF
},
111 { "CHAR_MIN", _SC_CHAR_MIN
, SYSCONF
},
114 { "CHILD_MAX", _SC_CHILD_MAX
, SYSCONF
},
117 { "CLK_TCK", _SC_CLK_TCK
, SYSCONF
},
120 { "INT_MAX", _SC_INT_MAX
, SYSCONF
},
123 { "INT_MIN", _SC_INT_MIN
, SYSCONF
},
125 #ifdef _SC_UIO_MAXIOV
126 { "IOV_MAX", _SC_UIO_MAXIOV
, SYSCONF
},
128 #ifdef _SC_LOGIN_NAME_MAX
129 { "LOGNAME_MAX", _SC_LOGIN_NAME_MAX
, SYSCONF
},
132 { "LONG_BIT", _SC_LONG_BIT
, SYSCONF
},
134 #ifdef _SC_MB_LEN_MAX
135 { "MB_LEN_MAX", _SC_MB_LEN_MAX
, SYSCONF
},
137 #ifdef _SC_NGROUPS_MAX
138 { "NGROUPS_MAX", _SC_NGROUPS_MAX
, SYSCONF
},
141 { "NL_ARGMAX", _SC_NL_ARGMAX
, SYSCONF
},
143 #ifdef _SC_NL_LANGMAX
144 { "NL_LANGMAX", _SC_NL_LANGMAX
, SYSCONF
},
147 { "NL_MSGMAX", _SC_NL_MSGMAX
, SYSCONF
},
150 { "NL_NMAX", _SC_NL_NMAX
, SYSCONF
},
153 { "NL_SETMAX", _SC_NL_SETMAX
, SYSCONF
},
155 #ifdef _SC_NL_TEXTMAX
156 { "NL_TEXTMAX", _SC_NL_TEXTMAX
, SYSCONF
},
158 #ifdef _SC_GETGR_R_SIZE_MAX
159 { "NSS_BUFLEN_GROUP", _SC_GETGR_R_SIZE_MAX
, SYSCONF
},
161 #ifdef _SC_GETPW_R_SIZE_MAX
162 { "NSS_BUFLEN_PASSWD", _SC_GETPW_R_SIZE_MAX
, SYSCONF
},
165 { "NZERO", _SC_NZERO
, SYSCONF
},
168 { "OPEN_MAX", _SC_OPEN_MAX
, SYSCONF
},
171 { "PAGESIZE", _SC_PAGESIZE
, SYSCONF
},
174 { "PAGE_SIZE", _SC_PAGESIZE
, SYSCONF
},
177 { "PASS_MAX", _SC_PASS_MAX
, SYSCONF
},
179 #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
180 { "PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS
, SYSCONF
},
182 #ifdef _SC_THREAD_KEYS_MAX
183 { "PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX
, SYSCONF
},
185 #ifdef _SC_THREAD_STACK_MIN
186 { "PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN
, SYSCONF
},
188 #ifdef _SC_THREAD_THREADS_MAX
189 { "PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX
, SYSCONF
},
192 { "SCHAR_MAX", _SC_SCHAR_MAX
, SYSCONF
},
195 { "SCHAR_MIN", _SC_SCHAR_MIN
, SYSCONF
},
198 { "SHRT_MAX", _SC_SHRT_MAX
, SYSCONF
},
201 { "SHRT_MIN", _SC_SHRT_MIN
, SYSCONF
},
204 { "SSIZE_MAX", _SC_SSIZE_MAX
, SYSCONF
},
206 #ifdef _SC_TTY_NAME_MAX
207 { "TTY_NAME_MAX", _SC_TTY_NAME_MAX
, SYSCONF
},
209 #ifdef _SC_TZNAME_MAX
210 { "TZNAME_MAX", _SC_TZNAME_MAX
, SYSCONF
},
213 { "UCHAR_MAX", _SC_UCHAR_MAX
, SYSCONF
},
216 { "UINT_MAX", _SC_UINT_MAX
, SYSCONF
},
218 #ifdef _SC_UIO_MAXIOV
219 { "UIO_MAXIOV", _SC_UIO_MAXIOV
, SYSCONF
},
222 { "ULONG_MAX", _SC_ULONG_MAX
, SYSCONF
},
225 { "USHRT_MAX", _SC_USHRT_MAX
, SYSCONF
},
228 { "WORD_BIT", _SC_WORD_BIT
, SYSCONF
},
230 #ifdef _SC_AVPHYS_PAGES
231 { "_AVPHYS_PAGES", _SC_AVPHYS_PAGES
, SYSCONF
},
233 #ifdef _SC_NPROCESSORS_CONF
234 { "_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF
, SYSCONF
},
236 #ifdef _SC_NPROCESSORS_ONLN
237 { "_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN
, SYSCONF
},
239 #ifdef _SC_PHYS_PAGES
240 { "_PHYS_PAGES", _SC_PHYS_PAGES
, SYSCONF
},
243 { "_POSIX_ARG_MAX", _SC_ARG_MAX
, SYSCONF
},
245 #ifdef _SC_ASYNCHRONOUS_IO
246 { "_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO
, SYSCONF
},
249 { "_POSIX_CHILD_MAX", _SC_CHILD_MAX
, SYSCONF
},
252 { "_POSIX_FSYNC", _SC_FSYNC
, SYSCONF
},
254 #ifdef _SC_JOB_CONTROL
255 { "_POSIX_JOB_CONTROL", _SC_JOB_CONTROL
, SYSCONF
},
257 #ifdef _SC_MAPPED_FILES
258 { "_POSIX_MAPPED_FILES", _SC_MAPPED_FILES
, SYSCONF
},
261 { "_POSIX_MEMLOCK", _SC_MEMLOCK
, SYSCONF
},
263 #ifdef _SC_MEMLOCK_RANGE
264 { "_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE
, SYSCONF
},
266 #ifdef _SC_MEMORY_PROTECTION
267 { "_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION
, SYSCONF
},
269 #ifdef _SC_MESSAGE_PASSING
270 { "_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING
, SYSCONF
},
272 #ifdef _SC_NGROUPS_MAX
273 { "_POSIX_NGROUPS_MAX", _SC_NGROUPS_MAX
, SYSCONF
},
276 { "_POSIX_OPEN_MAX", _SC_OPEN_MAX
, SYSCONF
},
279 { "_POSIX_PII", _SC_PII
, SYSCONF
},
281 #ifdef _SC_PII_INTERNET
282 { "_POSIX_PII_INTERNET", _SC_PII_INTERNET
, SYSCONF
},
284 #ifdef _SC_PII_INTERNET_DGRAM
285 { "_POSIX_PII_INTERNET_DGRAM", _SC_PII_INTERNET_DGRAM
, SYSCONF
},
287 #ifdef _SC_PII_INTERNET_STREAM
288 { "_POSIX_PII_INTERNET_STREAM", _SC_PII_INTERNET_STREAM
, SYSCONF
},
291 { "_POSIX_PII_OSI", _SC_PII_OSI
, SYSCONF
},
293 #ifdef _SC_PII_OSI_CLTS
294 { "_POSIX_PII_OSI_CLTS", _SC_PII_OSI_CLTS
, SYSCONF
},
296 #ifdef _SC_PII_OSI_COTS
297 { "_POSIX_PII_OSI_COTS", _SC_PII_OSI_COTS
, SYSCONF
},
300 { "_POSIX_PII_OSI_M", _SC_PII_OSI_M
, SYSCONF
},
302 #ifdef _SC_PII_SOCKET
303 { "_POSIX_PII_SOCKET", _SC_PII_SOCKET
, SYSCONF
},
306 { "_POSIX_PII_XTI", _SC_PII_XTI
, SYSCONF
},
309 { "_POSIX_POLL", _SC_POLL
, SYSCONF
},
311 #ifdef _SC_PRIORITIZED_IO
312 { "_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO
, SYSCONF
},
314 #ifdef _SC_PRIORITY_SCHEDULING
315 { "_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING
, SYSCONF
},
317 #ifdef _SC_REALTIME_SIGNALS
318 { "_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS
, SYSCONF
},
321 { "_POSIX_SAVED_IDS", _SC_SAVED_IDS
, SYSCONF
},
324 { "_POSIX_SELECT", _SC_SELECT
, SYSCONF
},
326 #ifdef _SC_SEMAPHORES
327 { "_POSIX_SEMAPHORES", _SC_SEMAPHORES
, SYSCONF
},
329 #ifdef _SC_SHARED_MEMORY_OBJECTS
330 { "_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS
, SYSCONF
},
333 { "_POSIX_SSIZE_MAX", _SC_SSIZE_MAX
, SYSCONF
},
335 #ifdef _SC_STREAM_MAX
336 { "_POSIX_STREAM_MAX", _SC_STREAM_MAX
, SYSCONF
},
338 #ifdef _SC_SYNCHRONIZED_IO
339 { "_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO
, SYSCONF
},
342 { "_POSIX_THREADS", _SC_THREADS
, SYSCONF
},
344 #ifdef _SC_THREAD_ATTR_STACKADDR
345 { "_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR
, SYSCONF
},
347 #ifdef _SC_THREAD_ATTR_STACKSIZE
348 { "_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE
, SYSCONF
},
350 #ifdef _SC_THREAD_PRIORITY_SCHEDULING
351 { "_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING
, SYSCONF
},
353 #ifdef _SC_THREAD_PRIO_INHERIT
354 { "_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT
, SYSCONF
},
356 #ifdef _SC_THREAD_PRIO_PROTECT
357 { "_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT
, SYSCONF
},
359 #ifdef _SC_THREAD_PROCESS_SHARED
360 { "_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED
, SYSCONF
},
362 #ifdef _SC_THREAD_SAFE_FUNCTIONS
363 { "_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS
, SYSCONF
},
366 { "_POSIX_TIMERS", _SC_TIMERS
, SYSCONF
},
369 { "TIMER_MAX", _SC_TIMER_MAX
, SYSCONF
},
371 #ifdef _SC_TZNAME_MAX
372 { "_POSIX_TZNAME_MAX", _SC_TZNAME_MAX
, SYSCONF
},
375 { "_POSIX_VERSION", _SC_VERSION
, SYSCONF
},
378 { "_T_IOV_MAX", _SC_T_IOV_MAX
, SYSCONF
},
380 #ifdef _SC_XOPEN_CRYPT
381 { "_XOPEN_CRYPT", _SC_XOPEN_CRYPT
, SYSCONF
},
383 #ifdef _SC_XOPEN_ENH_I18N
384 { "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N
, SYSCONF
},
386 #ifdef _SC_XOPEN_LEGACY
387 { "_XOPEN_LEGACY", _SC_XOPEN_LEGACY
, SYSCONF
},
389 #ifdef _SC_XOPEN_REALTIME
390 { "_XOPEN_REALTIME", _SC_XOPEN_REALTIME
, SYSCONF
},
392 #ifdef _SC_XOPEN_REALTIME_THREADS
393 { "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS
, SYSCONF
},
396 { "_XOPEN_SHM", _SC_XOPEN_SHM
, SYSCONF
},
398 #ifdef _SC_XOPEN_UNIX
399 { "_XOPEN_UNIX", _SC_XOPEN_UNIX
, SYSCONF
},
401 #ifdef _SC_XOPEN_VERSION
402 { "_XOPEN_VERSION", _SC_XOPEN_VERSION
, SYSCONF
},
404 #ifdef _SC_XOPEN_XCU_VERSION
405 { "_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION
, SYSCONF
},
407 #ifdef _SC_XOPEN_XPG2
408 { "_XOPEN_XPG2", _SC_XOPEN_XPG2
, SYSCONF
},
410 #ifdef _SC_XOPEN_XPG3
411 { "_XOPEN_XPG3", _SC_XOPEN_XPG3
, SYSCONF
},
413 #ifdef _SC_XOPEN_XPG4
414 { "_XOPEN_XPG4", _SC_XOPEN_XPG4
, SYSCONF
},
417 #ifdef _SC_BC_BASE_MAX
418 { "BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
420 #ifdef _SC_BC_DIM_MAX
421 { "BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
423 #ifdef _SC_BC_SCALE_MAX
424 { "BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
426 #ifdef _SC_BC_STRING_MAX
427 { "BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
429 { "CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX
, SYSCONF
},
430 #ifdef _SC_COLL_WEIGHTS_MAX
431 { "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
433 #ifdef _SC_EQUIV_CLASS_MAX
434 { "EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX
, SYSCONF
},
436 #ifdef _SC_EXPR_NEST_MAX
437 { "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
440 { "LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
442 #ifdef _SC_BC_BASE_MAX
443 { "POSIX2_BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
445 #ifdef _SC_BC_DIM_MAX
446 { "POSIX2_BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
448 #ifdef _SC_BC_SCALE_MAX
449 { "POSIX2_BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
451 #ifdef _SC_BC_STRING_MAX
452 { "POSIX2_BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
454 #ifdef _SC_2_CHAR_TERM
455 { "POSIX2_CHAR_TERM", _SC_2_CHAR_TERM
, SYSCONF
},
457 #ifdef _SC_COLL_WEIGHTS_MAX
458 { "POSIX2_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
461 { "POSIX2_C_BIND", _SC_2_C_BIND
, SYSCONF
},
464 { "POSIX2_C_DEV", _SC_2_C_DEV
, SYSCONF
},
466 #ifdef _SC_2_C_VERSION
467 { "POSIX2_C_VERSION", _SC_2_C_VERSION
, SYSCONF
},
469 #ifdef _SC_EXPR_NEST_MAX
470 { "POSIX2_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
472 #ifdef _SC_2_FORT_DEV
473 { "POSIX2_FORT_DEV", _SC_2_FORT_DEV
, SYSCONF
},
475 #ifdef _SC_2_FORT_RUN
476 { "POSIX2_FORT_RUN", _SC_2_FORT_RUN
, SYSCONF
},
479 { "_POSIX2_LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
481 #ifdef _SC_2_LOCALEDEF
482 { "POSIX2_LOCALEDEF", _SC_2_LOCALEDEF
, SYSCONF
},
484 #ifdef _SC_RE_DUP_MAX
485 { "POSIX2_RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
488 { "POSIX2_SW_DEV", _SC_2_SW_DEV
, SYSCONF
},
491 { "POSIX2_UPE", _SC_2_UPE
, SYSCONF
},
494 { "POSIX2_VERSION", _SC_2_VERSION
, SYSCONF
},
496 #ifdef _SC_RE_DUP_MAX
497 { "RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
501 { "PATH", _CS_PATH
, CONFSTR
},
502 { "CS_PATH", _CS_PATH
, CONFSTR
},
506 #ifdef _CS_LFS_CFLAGS
507 { "LFS_CFLAGS", _CS_LFS_CFLAGS
, CONFSTR
},
509 #ifdef _CS_LFS_LDFLAGS
510 { "LFS_LDFLAGS", _CS_LFS_LDFLAGS
, CONFSTR
},
513 { "LFS_LIBS", _CS_LFS_LIBS
, CONFSTR
},
515 #ifdef _CS_LFS_LINTFLAGS
516 { "LFS_LINTFLAGS", _CS_LFS_LINTFLAGS
, CONFSTR
},
518 #ifdef _CS_LFS64_CFLAGS
519 { "LFS64_CFLAGS", _CS_LFS64_CFLAGS
, CONFSTR
},
521 #ifdef _CS_LFS64_LDFLAGS
522 { "LFS64_LDFLAGS", _CS_LFS64_LDFLAGS
, CONFSTR
},
524 #ifdef _CS_LFS64_LIBS
525 { "LFS64_LIBS", _CS_LFS64_LIBS
, CONFSTR
},
527 #ifdef _CS_LFS64_LINTFLAGS
528 { "LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS
, CONFSTR
},
531 /* Programming environments. */
532 #ifdef _SC_XBS5_ILP32_OFF32
533 { "_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32
, SYSCONF
},
535 #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
536 { "XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS
, CONFSTR
},
538 #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
539 { "XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS
, CONFSTR
},
541 #ifdef _CS_XBS5_ILP32_OFF32_LIBS
542 { "XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS
, CONFSTR
},
544 #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
545 { "XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS
, CONFSTR
},
548 #ifdef _SC_XBS5_ILP32_OFFBIG
549 { "_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG
, SYSCONF
},
551 #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
552 { "XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS
, CONFSTR
},
554 #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
555 { "XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS
, CONFSTR
},
557 #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
558 { "XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS
, CONFSTR
},
560 #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
561 { "XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
, CONFSTR
},
564 #ifdef _SC_XBS5_LP64_OFF64
565 { "_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64
, SYSCONF
},
567 #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
568 { "XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS
, CONFSTR
},
570 #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
571 { "XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS
, CONFSTR
},
573 #ifdef _CS_XBS5_LP64_OFF64_LIBS
574 { "XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS
, CONFSTR
},
576 #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
577 { "XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS
, CONFSTR
},
580 #ifdef _SC_XBS5_LPBIG_OFFBIG
581 { "_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG
, SYSCONF
},
583 #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
584 { "XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS
, CONFSTR
},
586 #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
587 { "XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
, CONFSTR
},
589 #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
590 { "XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS
, CONFSTR
},
592 #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
593 { "XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
, CONFSTR
},
596 #ifdef _SC_V6_ILP32_OFF32
597 { "_POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32
, SYSCONF
},
599 #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
600 { "POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS
, CONFSTR
},
602 #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
603 { "POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
, CONFSTR
},
605 #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
606 { "POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS
, CONFSTR
},
608 #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
609 { "POSIX_V6_ILP32_OFF32_LINTFLAGS", _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
, CONFSTR
},
612 #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
613 { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_V6_WIDTH_RESTRICTED_ENVS
, CONFSTR
},
616 #ifdef _SC_V6_ILP32_OFFBIG
617 { "_POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG
, SYSCONF
},
619 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
620 { "POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
, CONFSTR
},
622 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
623 { "POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
, CONFSTR
},
625 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
626 { "POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS
, CONFSTR
},
628 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
629 { "POSIX_V6_ILP32_OFFBIG_LINTFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
, CONFSTR
},
632 #ifdef _SC_V6_LP64_OFF64
633 { "_POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64
, SYSCONF
},
635 #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
636 { "POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS
, CONFSTR
},
638 #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
639 { "POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS
, CONFSTR
},
641 #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
642 { "POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS
, CONFSTR
},
644 #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
645 { "POSIX_V6_LP64_OFF64_LINTFLAGS", _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
, CONFSTR
},
648 #ifdef _SC_V6_LPBIG_OFFBIG
649 { "_POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG
, SYSCONF
},
651 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
652 { "POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
, CONFSTR
},
654 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
655 { "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
, CONFSTR
},
657 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
658 { "POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
, CONFSTR
},
660 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
661 { "POSIX_V6_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
, CONFSTR
},
664 #ifdef _SC_ADVISORY_INFO
665 { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO
, SYSCONF
},
668 { "_POSIX_BARRIERS", _SC_BARRIERS
, SYSCONF
},
671 { "_POSIX_BASE", _SC_BASE
, SYSCONF
},
673 #ifdef _SC_C_LANG_SUPPORT
674 { "_POSIX_C_LANG_SUPPORT", _SC_C_LANG_SUPPORT
, SYSCONF
},
676 #ifdef _SC_C_LANG_SUPPORT_R
677 { "_POSIX_C_LANG_SUPPORT_R", _SC_C_LANG_SUPPORT_R
, SYSCONF
},
679 #ifdef _SC_CLOCK_SELECTION
680 { "_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION
, SYSCONF
},
683 { "_POSIX_CPUTIME", _SC_CPUTIME
, SYSCONF
},
685 #ifdef _SC_THREAD_CPUTIME
686 { "_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME
, SYSCONF
},
688 #ifdef _SC_DEVICE_SPECIFIC
689 { "_POSIX_DEVICE_SPECIFIC", _SC_DEVICE_SPECIFIC
, SYSCONF
},
691 #ifdef _SC_DEVICE_SPECIFIC_R
692 { "_POSIX_DEVICE_SPECIFIC_R", _SC_DEVICE_SPECIFIC_R
, SYSCONF
},
695 { "_POSIX_FD_MGMT", _SC_FD_MGMT
, SYSCONF
},
698 { "_POSIX_FIFO", _SC_FIFO
, SYSCONF
},
701 { "_POSIX_PIPE", _SC_PIPE
, SYSCONF
},
703 #ifdef _SC_FILE_ATTRIBUTES
704 { "_POSIX_FILE_ATTRIBUTES", _SC_FILE_ATTRIBUTES
, SYSCONF
},
706 #ifdef _SC_FILE_LOCKING
707 { "_POSIX_FILE_LOCKING", _SC_FILE_LOCKING
, SYSCONF
},
709 #ifdef _SC_FILE_SYSTEM
710 { "_POSIX_FILE_SYSTEM", _SC_FILE_SYSTEM
, SYSCONF
},
712 #ifdef _SC_MONOTONIC_CLOCK
713 { "_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK
, SYSCONF
},
715 #ifdef _SC_MULTI_PROCESS
716 { "_POSIX_MULTI_PROCESS", _SC_MULTI_PROCESS
, SYSCONF
},
718 #ifdef _SC_SINGLE_PROCESS
719 { "_POSIX_SINGLE_PROCESS", _SC_SINGLE_PROCESS
, SYSCONF
},
721 #ifdef _SC_NETWORKING
722 { "_POSIX_NETWORKING", _SC_NETWORKING
, SYSCONF
},
724 #ifdef _SC_READER_WRITER_LOCKS
725 { "_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS
, SYSCONF
},
727 #ifdef _SC_SPIN_LOCKS
728 { "_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS
, SYSCONF
},
731 { "_POSIX_REGEXP", _SC_REGEXP
, SYSCONF
},
733 #ifdef _SC_REGEX_VERSION
734 { "_REGEX_VERSION", _SC_REGEX_VERSION
, SYSCONF
},
737 { "_POSIX_SHELL", _SC_SHELL
, SYSCONF
},
740 { "_POSIX_SIGNALS", _SC_SIGNALS
, SYSCONF
},
743 { "_POSIX_SPAWN", _SC_SPAWN
, SYSCONF
},
745 #ifdef _SC_SPORADIC_SERVER
746 { "_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER
, SYSCONF
},
748 #ifdef _SC_THREAD_SPORADIC_SERVER
749 { "_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER
, SYSCONF
},
751 #ifdef _SC_SYSTEM_DATABASE
752 { "_POSIX_SYSTEM_DATABASE", _SC_SYSTEM_DATABASE
, SYSCONF
},
754 #ifdef _SC_SYSTEM_DATABASE_R
755 { "_POSIX_SYSTEM_DATABASE_R", _SC_SYSTEM_DATABASE_R
, SYSCONF
},
758 { "_POSIX_TIMEOUTS", _SC_TIMEOUTS
, SYSCONF
},
760 #ifdef _SC_TYPED_MEMORY_OBJECTS
761 { "_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS
, SYSCONF
},
763 #ifdef _SC_USER_GROUPS
764 { "_POSIX_USER_GROUPS", _SC_USER_GROUPS
, SYSCONF
},
766 #ifdef _SC_USER_GROUPS_R
767 { "_POSIX_USER_GROUPS_R", _SC_USER_GROUPS_R
, SYSCONF
},
770 { "POSIX2_PBS", _SC_2_PBS
, SYSCONF
},
772 #ifdef _SC_2_PBS_ACCOUNTING
773 { "POSIX2_PBS_ACCOUNTING", _SC_2_PBS_ACCOUNTING
, SYSCONF
},
775 #ifdef _SC_2_PBS_LOCATE
776 { "POSIX2_PBS_LOCATE", _SC_2_PBS_LOCATE
, SYSCONF
},
778 #ifdef _SC_2_PBS_TRACK
779 { "POSIX2_PBS_TRACK", _SC_2_PBS_TRACK
, SYSCONF
},
781 #ifdef _SC_2_PBS_MESSAGE
782 { "POSIX2_PBS_MESSAGE", _SC_2_PBS_MESSAGE
, SYSCONF
},
784 #ifdef _SC_SYMLOOP_MAX
785 { "SYMLOOP_MAX", _SC_SYMLOOP_MAX
, SYSCONF
},
787 #ifdef _SC_STREAM_MAX
788 { "STREAM_MAX", _SC_STREAM_MAX
, SYSCONF
},
790 #ifdef _SC_AIO_LISTIO_MAX
791 { "AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX
, SYSCONF
},
794 { "AIO_MAX", _SC_AIO_MAX
, SYSCONF
},
796 #ifdef _SC_AIO_PRIO_DELTA_MAX
797 { "AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX
, SYSCONF
},
799 #ifdef _SC_DELAYTIMER_MAX
800 { "DELAYTIMER_MAX", _SC_DELAYTIMER_MAX
, SYSCONF
},
802 #ifdef _SC_HOST_NAME_MAX
803 { "HOST_NAME_MAX", _SC_HOST_NAME_MAX
, SYSCONF
},
805 #ifdef _SC_LOGIN_NAME_MAX
806 { "LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX
, SYSCONF
},
808 #ifdef _SC_MQ_OPEN_MAX
809 { "MQ_OPEN_MAX", _SC_MQ_OPEN_MAX
, SYSCONF
},
811 #ifdef _SC_MQ_PRIO_MAX
812 { "MQ_PRIO_MAX", _SC_MQ_PRIO_MAX
, SYSCONF
},
815 { "_POSIX_DEVICE_IO", _SC_DEVICE_IO
, SYSCONF
},
818 { "_POSIX_TRACE", _SC_TRACE
, SYSCONF
},
820 #ifdef _SC_TRACE_EVENT_FILTER
821 { "_POSIX_TRACE_EVENT_FILTER", _SC_TRACE_EVENT_FILTER
, SYSCONF
},
823 #ifdef _SC_TRACE_INHERIT
824 { "_POSIX_TRACE_INHERIT", _SC_TRACE_INHERIT
, SYSCONF
},
827 { "_POSIX_TRACE_LOG", _SC_TRACE_LOG
, SYSCONF
},
830 { "RTSIG_MAX", _SC_RTSIG_MAX
, SYSCONF
},
832 #ifdef _SC_SEM_NSEMS_MAX
833 { "SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX
, SYSCONF
},
835 #ifdef _SC_SEM_VALUE_MAX
836 { "SEM_VALUE_MAX", _SC_SEM_VALUE_MAX
, SYSCONF
},
838 #ifdef _SC_SIGQUEUE_MAX
839 { "SIGQUEUE_MAX", _SC_SIGQUEUE_MAX
, SYSCONF
},
841 #ifdef _PC_FILESIZEBITS
842 { "FILESIZEBITS", _PC_FILESIZEBITS
, PATHCONF
},
844 #ifdef _PC_ALLOC_SIZE_MIN
845 { "POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN
, PATHCONF
},
847 #ifdef _PC_REC_INCR_XFER_SIZE
848 { "POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE
, PATHCONF
},
850 #ifdef _PC_REC_MAX_XFER_SIZE
851 { "POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE
, PATHCONF
},
853 #ifdef _PC_REC_MIN_XFER_SIZE
854 { "POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE
, PATHCONF
},
856 #ifdef _PC_REC_XFER_ALIGN
857 { "POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN
, PATHCONF
},
859 #ifdef _PC_SYMLINK_MAX
860 { "SYMLINK_MAX", _PC_SYMLINK_MAX
, PATHCONF
},
862 #ifdef _CS_GNU_LIBC_VERSION
863 { "GNU_LIBC_VERSION", _CS_GNU_LIBC_VERSION
, CONFSTR
},
865 #ifdef _CS_GNU_LIBPTHREAD_VERSION
866 { "GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION
, CONFSTR
},
868 #ifdef _PC_2_SYMLINKS
869 { "POSIX2_SYMLINKS", _PC_2_SYMLINKS
, PATHCONF
},
872 #ifdef _SC_LEVEL1_ICACHE_SIZE
873 { "LEVEL1_ICACHE_SIZE", _SC_LEVEL1_ICACHE_SIZE
, SYSCONF
},
875 #ifdef _SC_LEVEL1_ICACHE_ASSOC
876 { "LEVEL1_ICACHE_ASSOC", _SC_LEVEL1_ICACHE_ASSOC
, SYSCONF
},
878 #ifdef _SC_LEVEL1_ICACHE_LINESIZE
879 { "LEVEL1_ICACHE_LINESIZE", _SC_LEVEL1_ICACHE_LINESIZE
, SYSCONF
},
881 #ifdef _SC_LEVEL1_DCACHE_SIZE
882 { "LEVEL1_DCACHE_SIZE", _SC_LEVEL1_DCACHE_SIZE
, SYSCONF
},
884 #ifdef _SC_LEVEL1_DCACHE_ASSOC
885 { "LEVEL1_DCACHE_ASSOC", _SC_LEVEL1_DCACHE_ASSOC
, SYSCONF
},
887 #ifdef _SC_LEVEL1_DCACHE_LINESIZE
888 { "LEVEL1_DCACHE_LINESIZE", _SC_LEVEL1_DCACHE_LINESIZE
, SYSCONF
},
890 #ifdef _SC_LEVEL2_CACHE_SIZE
891 { "LEVEL2_CACHE_SIZE", _SC_LEVEL2_CACHE_SIZE
, SYSCONF
},
893 #ifdef _SC_LEVEL2_CACHE_ASSOC
894 { "LEVEL2_CACHE_ASSOC", _SC_LEVEL2_CACHE_ASSOC
, SYSCONF
},
896 #ifdef _SC_LEVEL2_CACHE_LINESIZE
897 { "LEVEL2_CACHE_LINESIZE", _SC_LEVEL2_CACHE_LINESIZE
, SYSCONF
},
899 #ifdef _SC_LEVEL3_CACHE_SIZE
900 { "LEVEL3_CACHE_SIZE", _SC_LEVEL3_CACHE_SIZE
, SYSCONF
},
902 #ifdef _SC_LEVEL3_CACHE_ASSOC
903 { "LEVEL3_CACHE_ASSOC", _SC_LEVEL3_CACHE_ASSOC
, SYSCONF
},
905 #ifdef _SC_LEVEL3_CACHE_LINESIZE
906 { "LEVEL3_CACHE_LINESIZE", _SC_LEVEL3_CACHE_LINESIZE
, SYSCONF
},
908 #ifdef _SC_LEVEL4_CACHE_SIZE
909 { "LEVEL4_CACHE_SIZE", _SC_LEVEL4_CACHE_SIZE
, SYSCONF
},
911 #ifdef _SC_LEVEL4_CACHE_ASSOC
912 { "LEVEL4_CACHE_ASSOC", _SC_LEVEL4_CACHE_ASSOC
, SYSCONF
},
916 { "IPV6", _SC_IPV6
, SYSCONF
},
918 #ifdef _SC_RAW_SOCKETS
919 { "RAW_SOCKETS", _SC_RAW_SOCKETS
, SYSCONF
},
926 static struct { const char *name
; int num
; } specs
[] =
928 { "POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32
},
929 { "POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG
},
930 { "POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64
},
931 { "POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG
}
933 static const int nspecs
= sizeof (specs
) / sizeof (specs
[0]);
935 extern const char *__progname
;
942 _("Usage: %s [-v specification] variable_name [pathname]\n"),
945 _(" %s -a [pathname]\n"), __progname
);
950 print_all (const char *path
)
952 register const struct conf
*c
;
956 for (c
= vars
; c
->name
!= NULL
; ++c
) {
957 printf("%-35s", c
->name
);
960 value
= pathconf (path
, c
->call_name
);
962 printf("%ld", value
);
967 value
= sysconf (c
->call_name
);
969 if (c
->call_name
== _SC_UINT_MAX
970 || c
->call_name
== _SC_ULONG_MAX
)
971 printf ("%lu", value
);
974 printf ("%ld", value
);
979 clen
= confstr (c
->call_name
, (char *) NULL
, 0);
980 cvalue
= (char *) malloc (clen
);
982 error (3, 0, _("memory exhausted"));
983 if (confstr (c
->call_name
, cvalue
, clen
) != clen
)
984 error (3, errno
, "confstr");
985 printf ("%.*s\n", (int) clen
, cvalue
);
993 main (int argc
, char *argv
[])
995 register const struct conf
*c
;
997 /* Set locale. Do not set LC_ALL because the other categories must
998 not be affected (according to POSIX.2). */
999 setlocale (LC_CTYPE
, "");
1000 setlocale (LC_MESSAGES
, "");
1002 /* Initialize the message catalog. */
1003 textdomain (PACKAGE
);
1005 if (argc
> 1 && strcmp (argv
[1], "--version") == 0)
1007 fprintf (stderr
, "getconf (GNU %s) %s\n", PACKAGE
, VERSION
);
1008 fprintf (stderr
, gettext ("\
1009 Copyright (C) %s Free Software Foundation, Inc.\n\
1010 This is free software; see the source for copying conditions. There is NO\n\
1011 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
1013 fprintf (stderr
, gettext ("Written by %s.\n"), "Roland McGrath");
1017 const char *getconf_dir
= getenv ("GETCONF_DIR") ?: GETCONF_DIR
;
1018 size_t getconf_dirlen
= strlen (getconf_dir
);
1020 const char *spec
= NULL
;
1021 char buf
[sizeof "POSIX_V6_LPBIG_OFFBIG"];
1022 char *argv0
= argv
[0];
1023 if (argc
> 1 && strncmp (argv
[1], "-v", 2) == 0)
1025 if (argv
[1][2] == '\0')
1043 char default_name
[getconf_dirlen
+ sizeof "/default"];
1044 memcpy (mempcpy (default_name
, getconf_dir
, getconf_dirlen
),
1045 "/default", sizeof "/default");
1046 int len
= readlink (default_name
, buf
, sizeof buf
- 1);
1054 /* Check for the specifications we know. */
1058 for (i
= 0; i
< nspecs
; ++i
)
1059 if (strcmp (spec
, specs
[i
].name
) == 0)
1063 error (2, 0, _("unknown specification \"%s\""), spec
);
1065 switch (specs
[i
].num
)
1067 #ifndef _POSIX_V6_ILP32_OFF32
1068 case _SC_V6_ILP32_OFF32
:
1070 #ifndef _POSIX_V6_ILP32_OFFBIG
1071 case _SC_V6_ILP32_OFFBIG
:
1073 #ifndef _POSIX_V6_LP64_OFF64
1074 case _SC_V6_LP64_OFF64
:
1076 #ifndef _POSIX_V6_LPBIG_OFFBIG
1077 case _SC_V6_LPBIG_OFFBIG
:
1080 const char *args
[argc
+ 3];
1081 size_t spec_len
= strlen (spec
);
1082 char getconf_name
[getconf_dirlen
+ 1 + spec_len
+ 1];
1083 memcpy (mempcpy (mempcpy (getconf_name
, getconf_dir
,
1085 "/", 1), spec
, spec_len
+ 1);
1089 memcpy (&args
[3], &argv
[1], argc
* sizeof (argv
[1]));
1090 execv (getconf_name
, (char * const *) args
);
1091 error (4, errno
, _("Couldn't execute %s"), getconf_name
);
1098 if (argc
> 1 && strcmp (argv
[1], "-a") == 0)
1103 print_all (argv
[2]);
1108 if (argc
< 2 || argc
> 3)
1111 for (c
= vars
; c
->name
!= NULL
; ++c
)
1112 if (strcmp (c
->name
, argv
[1]) == 0
1113 || (strncmp (c
->name
, "_POSIX_", 7) == 0
1114 && strcmp (c
->name
+ 7, argv
[1]) == 0))
1125 value
= pathconf (argv
[2], c
->call_name
);
1129 error (3, errno
, "pathconf: %s", argv
[2]);
1131 puts (_("undefined"));
1134 printf ("%ld\n", value
);
1140 value
= sysconf (c
->call_name
);
1143 if (c
->call_name
== _SC_UINT_MAX
1144 || c
->call_name
== _SC_ULONG_MAX
)
1145 printf ("%lu\n", value
);
1147 puts (_("undefined"));
1150 printf ("%ld\n", value
);
1156 clen
= confstr (c
->call_name
, (char *) NULL
, 0);
1157 cvalue
= (char *) malloc (clen
);
1159 error (3, 0, _("memory exhausted"));
1161 if (confstr (c
->call_name
, cvalue
, clen
) != clen
)
1162 error (3, errno
, "confstr");
1164 printf ("%.*s\n", (int) clen
, cvalue
);
1169 error (2, 0, _("Unrecognized variable `%s'"), argv
[1]);