1 /* Copyright (C) 1991, 92, 1995-2006, 2007 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU 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, write to the Free Software Foundation,
15 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 #include "../version.h"
27 #define PACKAGE _libc_intl_domainname
33 const enum { SYSCONF
, CONFSTR
, PATHCONF
} call
;
36 static const struct conf vars
[] =
39 { "LINK_MAX", _PC_LINK_MAX
, PATHCONF
},
42 { "_POSIX_LINK_MAX", _PC_LINK_MAX
, PATHCONF
},
45 { "MAX_CANON", _PC_MAX_CANON
, PATHCONF
},
48 { "_POSIX_MAX_CANON", _PC_MAX_CANON
, PATHCONF
},
51 { "MAX_INPUT", _PC_MAX_INPUT
, PATHCONF
},
54 { "_POSIX_MAX_INPUT", _PC_MAX_INPUT
, PATHCONF
},
57 { "NAME_MAX", _PC_NAME_MAX
, PATHCONF
},
60 { "_POSIX_NAME_MAX", _PC_NAME_MAX
, PATHCONF
},
63 { "PATH_MAX", _PC_PATH_MAX
, PATHCONF
},
66 { "_POSIX_PATH_MAX", _PC_PATH_MAX
, PATHCONF
},
69 { "PIPE_BUF", _PC_PIPE_BUF
, PATHCONF
},
72 { "_POSIX_PIPE_BUF", _PC_PIPE_BUF
, PATHCONF
},
74 #ifdef _PC_SOCK_MAXBUF
75 { "SOCK_MAXBUF", _PC_SOCK_MAXBUF
, PATHCONF
},
78 { "_POSIX_ASYNC_IO", _PC_ASYNC_IO
, PATHCONF
},
80 #ifdef _PC_CHOWN_RESTRICTED
81 { "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED
, PATHCONF
},
84 { "_POSIX_NO_TRUNC", _PC_NO_TRUNC
, PATHCONF
},
87 { "_POSIX_PRIO_IO", _PC_PRIO_IO
, PATHCONF
},
90 { "_POSIX_SYNC_IO", _PC_SYNC_IO
, PATHCONF
},
93 { "_POSIX_VDISABLE", _PC_VDISABLE
, PATHCONF
},
97 { "ARG_MAX", _SC_ARG_MAX
, SYSCONF
},
100 { "ATEXIT_MAX", _SC_ATEXIT_MAX
, SYSCONF
},
103 { "CHAR_BIT", _SC_CHAR_BIT
, SYSCONF
},
106 { "CHAR_MAX", _SC_CHAR_MAX
, SYSCONF
},
109 { "CHAR_MIN", _SC_CHAR_MIN
, SYSCONF
},
112 { "CHILD_MAX", _SC_CHILD_MAX
, SYSCONF
},
115 { "CLK_TCK", _SC_CLK_TCK
, SYSCONF
},
118 { "INT_MAX", _SC_INT_MAX
, SYSCONF
},
121 { "INT_MIN", _SC_INT_MIN
, SYSCONF
},
123 #ifdef _SC_UIO_MAXIOV
124 { "IOV_MAX", _SC_UIO_MAXIOV
, SYSCONF
},
126 #ifdef _SC_LOGIN_NAME_MAX
127 { "LOGNAME_MAX", _SC_LOGIN_NAME_MAX
, SYSCONF
},
130 { "LONG_BIT", _SC_LONG_BIT
, SYSCONF
},
132 #ifdef _SC_MB_LEN_MAX
133 { "MB_LEN_MAX", _SC_MB_LEN_MAX
, SYSCONF
},
135 #ifdef _SC_NGROUPS_MAX
136 { "NGROUPS_MAX", _SC_NGROUPS_MAX
, SYSCONF
},
139 { "NL_ARGMAX", _SC_NL_ARGMAX
, SYSCONF
},
141 #ifdef _SC_NL_LANGMAX
142 { "NL_LANGMAX", _SC_NL_LANGMAX
, SYSCONF
},
145 { "NL_MSGMAX", _SC_NL_MSGMAX
, SYSCONF
},
148 { "NL_NMAX", _SC_NL_NMAX
, SYSCONF
},
151 { "NL_SETMAX", _SC_NL_SETMAX
, SYSCONF
},
153 #ifdef _SC_NL_TEXTMAX
154 { "NL_TEXTMAX", _SC_NL_TEXTMAX
, SYSCONF
},
156 #ifdef _SC_GETGR_R_SIZE_MAX
157 { "NSS_BUFLEN_GROUP", _SC_GETGR_R_SIZE_MAX
, SYSCONF
},
159 #ifdef _SC_GETPW_R_SIZE_MAX
160 { "NSS_BUFLEN_PASSWD", _SC_GETPW_R_SIZE_MAX
, SYSCONF
},
163 { "NZERO", _SC_NZERO
, SYSCONF
},
166 { "OPEN_MAX", _SC_OPEN_MAX
, SYSCONF
},
169 { "PAGESIZE", _SC_PAGESIZE
, SYSCONF
},
172 { "PAGE_SIZE", _SC_PAGESIZE
, SYSCONF
},
175 { "PASS_MAX", _SC_PASS_MAX
, SYSCONF
},
177 #ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS
178 { "PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS
, SYSCONF
},
180 #ifdef _SC_THREAD_KEYS_MAX
181 { "PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX
, SYSCONF
},
183 #ifdef _SC_THREAD_STACK_MIN
184 { "PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN
, SYSCONF
},
186 #ifdef _SC_THREAD_THREADS_MAX
187 { "PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX
, SYSCONF
},
190 { "SCHAR_MAX", _SC_SCHAR_MAX
, SYSCONF
},
193 { "SCHAR_MIN", _SC_SCHAR_MIN
, SYSCONF
},
196 { "SHRT_MAX", _SC_SHRT_MAX
, SYSCONF
},
199 { "SHRT_MIN", _SC_SHRT_MIN
, SYSCONF
},
202 { "SSIZE_MAX", _SC_SSIZE_MAX
, SYSCONF
},
204 #ifdef _SC_TTY_NAME_MAX
205 { "TTY_NAME_MAX", _SC_TTY_NAME_MAX
, SYSCONF
},
207 #ifdef _SC_TZNAME_MAX
208 { "TZNAME_MAX", _SC_TZNAME_MAX
, SYSCONF
},
211 { "UCHAR_MAX", _SC_UCHAR_MAX
, SYSCONF
},
214 { "UINT_MAX", _SC_UINT_MAX
, SYSCONF
},
216 #ifdef _SC_UIO_MAXIOV
217 { "UIO_MAXIOV", _SC_UIO_MAXIOV
, SYSCONF
},
220 { "ULONG_MAX", _SC_ULONG_MAX
, SYSCONF
},
223 { "USHRT_MAX", _SC_USHRT_MAX
, SYSCONF
},
226 { "WORD_BIT", _SC_WORD_BIT
, SYSCONF
},
228 #ifdef _SC_AVPHYS_PAGES
229 { "_AVPHYS_PAGES", _SC_AVPHYS_PAGES
, SYSCONF
},
231 #ifdef _SC_NPROCESSORS_CONF
232 { "_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF
, SYSCONF
},
234 #ifdef _SC_NPROCESSORS_ONLN
235 { "_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN
, SYSCONF
},
237 #ifdef _SC_PHYS_PAGES
238 { "_PHYS_PAGES", _SC_PHYS_PAGES
, SYSCONF
},
241 { "_POSIX_ARG_MAX", _SC_ARG_MAX
, SYSCONF
},
243 #ifdef _SC_ASYNCHRONOUS_IO
244 { "_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO
, SYSCONF
},
247 { "_POSIX_CHILD_MAX", _SC_CHILD_MAX
, SYSCONF
},
250 { "_POSIX_FSYNC", _SC_FSYNC
, SYSCONF
},
252 #ifdef _SC_JOB_CONTROL
253 { "_POSIX_JOB_CONTROL", _SC_JOB_CONTROL
, SYSCONF
},
255 #ifdef _SC_MAPPED_FILES
256 { "_POSIX_MAPPED_FILES", _SC_MAPPED_FILES
, SYSCONF
},
259 { "_POSIX_MEMLOCK", _SC_MEMLOCK
, SYSCONF
},
261 #ifdef _SC_MEMLOCK_RANGE
262 { "_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE
, SYSCONF
},
264 #ifdef _SC_MEMORY_PROTECTION
265 { "_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION
, SYSCONF
},
267 #ifdef _SC_MESSAGE_PASSING
268 { "_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING
, SYSCONF
},
270 #ifdef _SC_NGROUPS_MAX
271 { "_POSIX_NGROUPS_MAX", _SC_NGROUPS_MAX
, SYSCONF
},
274 { "_POSIX_OPEN_MAX", _SC_OPEN_MAX
, SYSCONF
},
277 { "_POSIX_PII", _SC_PII
, SYSCONF
},
279 #ifdef _SC_PII_INTERNET
280 { "_POSIX_PII_INTERNET", _SC_PII_INTERNET
, SYSCONF
},
282 #ifdef _SC_PII_INTERNET_DGRAM
283 { "_POSIX_PII_INTERNET_DGRAM", _SC_PII_INTERNET_DGRAM
, SYSCONF
},
285 #ifdef _SC_PII_INTERNET_STREAM
286 { "_POSIX_PII_INTERNET_STREAM", _SC_PII_INTERNET_STREAM
, SYSCONF
},
289 { "_POSIX_PII_OSI", _SC_PII_OSI
, SYSCONF
},
291 #ifdef _SC_PII_OSI_CLTS
292 { "_POSIX_PII_OSI_CLTS", _SC_PII_OSI_CLTS
, SYSCONF
},
294 #ifdef _SC_PII_OSI_COTS
295 { "_POSIX_PII_OSI_COTS", _SC_PII_OSI_COTS
, SYSCONF
},
298 { "_POSIX_PII_OSI_M", _SC_PII_OSI_M
, SYSCONF
},
300 #ifdef _SC_PII_SOCKET
301 { "_POSIX_PII_SOCKET", _SC_PII_SOCKET
, SYSCONF
},
304 { "_POSIX_PII_XTI", _SC_PII_XTI
, SYSCONF
},
307 { "_POSIX_POLL", _SC_POLL
, SYSCONF
},
309 #ifdef _SC_PRIORITIZED_IO
310 { "_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO
, SYSCONF
},
312 #ifdef _SC_PRIORITY_SCHEDULING
313 { "_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING
, SYSCONF
},
315 #ifdef _SC_REALTIME_SIGNALS
316 { "_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS
, SYSCONF
},
319 { "_POSIX_SAVED_IDS", _SC_SAVED_IDS
, SYSCONF
},
322 { "_POSIX_SELECT", _SC_SELECT
, SYSCONF
},
324 #ifdef _SC_SEMAPHORES
325 { "_POSIX_SEMAPHORES", _SC_SEMAPHORES
, SYSCONF
},
327 #ifdef _SC_SHARED_MEMORY_OBJECTS
328 { "_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS
, SYSCONF
},
331 { "_POSIX_SSIZE_MAX", _SC_SSIZE_MAX
, SYSCONF
},
333 #ifdef _SC_STREAM_MAX
334 { "_POSIX_STREAM_MAX", _SC_STREAM_MAX
, SYSCONF
},
336 #ifdef _SC_SYNCHRONIZED_IO
337 { "_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO
, SYSCONF
},
340 { "_POSIX_THREADS", _SC_THREADS
, SYSCONF
},
342 #ifdef _SC_THREAD_ATTR_STACKADDR
343 { "_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR
, SYSCONF
},
345 #ifdef _SC_THREAD_ATTR_STACKSIZE
346 { "_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE
, SYSCONF
},
348 #ifdef _SC_THREAD_PRIORITY_SCHEDULING
349 { "_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING
, SYSCONF
},
351 #ifdef _SC_THREAD_PRIO_INHERIT
352 { "_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT
, SYSCONF
},
354 #ifdef _SC_THREAD_PRIO_PROTECT
355 { "_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT
, SYSCONF
},
357 #ifdef _SC_THREAD_PROCESS_SHARED
358 { "_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED
, SYSCONF
},
360 #ifdef _SC_THREAD_SAFE_FUNCTIONS
361 { "_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS
, SYSCONF
},
364 { "_POSIX_TIMERS", _SC_TIMERS
, SYSCONF
},
367 { "TIMER_MAX", _SC_TIMER_MAX
, SYSCONF
},
369 #ifdef _SC_TZNAME_MAX
370 { "_POSIX_TZNAME_MAX", _SC_TZNAME_MAX
, SYSCONF
},
373 { "_POSIX_VERSION", _SC_VERSION
, SYSCONF
},
376 { "_T_IOV_MAX", _SC_T_IOV_MAX
, SYSCONF
},
378 #ifdef _SC_XOPEN_CRYPT
379 { "_XOPEN_CRYPT", _SC_XOPEN_CRYPT
, SYSCONF
},
381 #ifdef _SC_XOPEN_ENH_I18N
382 { "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N
, SYSCONF
},
384 #ifdef _SC_XOPEN_LEGACY
385 { "_XOPEN_LEGACY", _SC_XOPEN_LEGACY
, SYSCONF
},
387 #ifdef _SC_XOPEN_REALTIME
388 { "_XOPEN_REALTIME", _SC_XOPEN_REALTIME
, SYSCONF
},
390 #ifdef _SC_XOPEN_REALTIME_THREADS
391 { "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS
, SYSCONF
},
394 { "_XOPEN_SHM", _SC_XOPEN_SHM
, SYSCONF
},
396 #ifdef _SC_XOPEN_UNIX
397 { "_XOPEN_UNIX", _SC_XOPEN_UNIX
, SYSCONF
},
399 #ifdef _SC_XOPEN_VERSION
400 { "_XOPEN_VERSION", _SC_XOPEN_VERSION
, SYSCONF
},
402 #ifdef _SC_XOPEN_XCU_VERSION
403 { "_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION
, SYSCONF
},
405 #ifdef _SC_XOPEN_XPG2
406 { "_XOPEN_XPG2", _SC_XOPEN_XPG2
, SYSCONF
},
408 #ifdef _SC_XOPEN_XPG3
409 { "_XOPEN_XPG3", _SC_XOPEN_XPG3
, SYSCONF
},
411 #ifdef _SC_XOPEN_XPG4
412 { "_XOPEN_XPG4", _SC_XOPEN_XPG4
, SYSCONF
},
415 #ifdef _SC_BC_BASE_MAX
416 { "BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
418 #ifdef _SC_BC_DIM_MAX
419 { "BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
421 #ifdef _SC_BC_SCALE_MAX
422 { "BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
424 #ifdef _SC_BC_STRING_MAX
425 { "BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
427 { "CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX
, SYSCONF
},
428 #ifdef _SC_COLL_WEIGHTS_MAX
429 { "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
431 #ifdef _SC_EQUIV_CLASS_MAX
432 { "EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX
, SYSCONF
},
434 #ifdef _SC_EXPR_NEST_MAX
435 { "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
438 { "LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
440 #ifdef _SC_BC_BASE_MAX
441 { "POSIX2_BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
443 #ifdef _SC_BC_DIM_MAX
444 { "POSIX2_BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
446 #ifdef _SC_BC_SCALE_MAX
447 { "POSIX2_BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
449 #ifdef _SC_BC_STRING_MAX
450 { "POSIX2_BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
452 #ifdef _SC_2_CHAR_TERM
453 { "POSIX2_CHAR_TERM", _SC_2_CHAR_TERM
, SYSCONF
},
455 #ifdef _SC_COLL_WEIGHTS_MAX
456 { "POSIX2_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
459 { "POSIX2_C_BIND", _SC_2_C_BIND
, SYSCONF
},
462 { "POSIX2_C_DEV", _SC_2_C_DEV
, SYSCONF
},
464 #ifdef _SC_2_C_VERSION
465 { "POSIX2_C_VERSION", _SC_2_C_VERSION
, SYSCONF
},
467 #ifdef _SC_EXPR_NEST_MAX
468 { "POSIX2_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
470 #ifdef _SC_2_FORT_DEV
471 { "POSIX2_FORT_DEV", _SC_2_FORT_DEV
, SYSCONF
},
473 #ifdef _SC_2_FORT_RUN
474 { "POSIX2_FORT_RUN", _SC_2_FORT_RUN
, SYSCONF
},
477 { "_POSIX2_LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
479 #ifdef _SC_2_LOCALEDEF
480 { "POSIX2_LOCALEDEF", _SC_2_LOCALEDEF
, SYSCONF
},
482 #ifdef _SC_RE_DUP_MAX
483 { "POSIX2_RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
486 { "POSIX2_SW_DEV", _SC_2_SW_DEV
, SYSCONF
},
489 { "POSIX2_UPE", _SC_2_UPE
, SYSCONF
},
492 { "POSIX2_VERSION", _SC_2_VERSION
, SYSCONF
},
494 #ifdef _SC_RE_DUP_MAX
495 { "RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
499 { "PATH", _CS_PATH
, CONFSTR
},
500 { "CS_PATH", _CS_PATH
, CONFSTR
},
504 #ifdef _CS_LFS_CFLAGS
505 { "LFS_CFLAGS", _CS_LFS_CFLAGS
, CONFSTR
},
507 #ifdef _CS_LFS_LDFLAGS
508 { "LFS_LDFLAGS", _CS_LFS_LDFLAGS
, CONFSTR
},
511 { "LFS_LIBS", _CS_LFS_LIBS
, CONFSTR
},
513 #ifdef _CS_LFS_LINTFLAGS
514 { "LFS_LINTFLAGS", _CS_LFS_LINTFLAGS
, CONFSTR
},
516 #ifdef _CS_LFS64_CFLAGS
517 { "LFS64_CFLAGS", _CS_LFS64_CFLAGS
, CONFSTR
},
519 #ifdef _CS_LFS64_LDFLAGS
520 { "LFS64_LDFLAGS", _CS_LFS64_LDFLAGS
, CONFSTR
},
522 #ifdef _CS_LFS64_LIBS
523 { "LFS64_LIBS", _CS_LFS64_LIBS
, CONFSTR
},
525 #ifdef _CS_LFS64_LINTFLAGS
526 { "LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS
, CONFSTR
},
529 /* Programming environments. */
530 #ifdef _SC_XBS5_ILP32_OFF32
531 { "_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32
, SYSCONF
},
533 #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
534 { "XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS
, CONFSTR
},
536 #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
537 { "XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS
, CONFSTR
},
539 #ifdef _CS_XBS5_ILP32_OFF32_LIBS
540 { "XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS
, CONFSTR
},
542 #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
543 { "XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS
, CONFSTR
},
546 #ifdef _SC_XBS5_ILP32_OFFBIG
547 { "_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG
, SYSCONF
},
549 #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
550 { "XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS
, CONFSTR
},
552 #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
553 { "XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS
, CONFSTR
},
555 #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
556 { "XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS
, CONFSTR
},
558 #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
559 { "XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
, CONFSTR
},
562 #ifdef _SC_XBS5_LP64_OFF64
563 { "_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64
, SYSCONF
},
565 #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
566 { "XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS
, CONFSTR
},
568 #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
569 { "XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS
, CONFSTR
},
571 #ifdef _CS_XBS5_LP64_OFF64_LIBS
572 { "XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS
, CONFSTR
},
574 #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
575 { "XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS
, CONFSTR
},
578 #ifdef _SC_XBS5_LPBIG_OFFBIG
579 { "_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG
, SYSCONF
},
581 #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
582 { "XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS
, CONFSTR
},
584 #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
585 { "XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
, CONFSTR
},
587 #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
588 { "XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS
, CONFSTR
},
590 #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
591 { "XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
, CONFSTR
},
594 #ifdef _SC_V6_ILP32_OFF32
595 { "_POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32
, SYSCONF
},
597 #ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS
598 { "POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS
, CONFSTR
},
600 #ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
601 { "POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
, CONFSTR
},
603 #ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS
604 { "POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS
, CONFSTR
},
606 #ifdef _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
607 { "POSIX_V6_ILP32_OFF32_LINTFLAGS", _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS
, CONFSTR
},
610 #ifdef _CS_V6_WIDTH_RESTRICTED_ENVS
611 { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_V6_WIDTH_RESTRICTED_ENVS
, CONFSTR
},
614 #ifdef _SC_V6_ILP32_OFFBIG
615 { "_POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG
, SYSCONF
},
617 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
618 { "POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
, CONFSTR
},
620 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
621 { "POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
, CONFSTR
},
623 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS
624 { "POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS
, CONFSTR
},
626 #ifdef _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
627 { "POSIX_V6_ILP32_OFFBIG_LINTFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS
, CONFSTR
},
630 #ifdef _SC_V6_LP64_OFF64
631 { "_POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64
, SYSCONF
},
633 #ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS
634 { "POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS
, CONFSTR
},
636 #ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS
637 { "POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS
, CONFSTR
},
639 #ifdef _CS_POSIX_V6_LP64_OFF64_LIBS
640 { "POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS
, CONFSTR
},
642 #ifdef _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
643 { "POSIX_V6_LP64_OFF64_LINTFLAGS", _CS_POSIX_V6_LP64_OFF64_LINTFLAGS
, CONFSTR
},
646 #ifdef _SC_V6_LPBIG_OFFBIG
647 { "_POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG
, SYSCONF
},
649 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
650 { "POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
, CONFSTR
},
652 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
653 { "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
, CONFSTR
},
655 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
656 { "POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
, CONFSTR
},
658 #ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
659 { "POSIX_V6_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
, CONFSTR
},
662 #ifdef _SC_ADVISORY_INFO
663 { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO
, SYSCONF
},
666 { "_POSIX_BARRIERS", _SC_BARRIERS
, SYSCONF
},
669 { "_POSIX_BASE", _SC_BASE
, SYSCONF
},
671 #ifdef _SC_C_LANG_SUPPORT
672 { "_POSIX_C_LANG_SUPPORT", _SC_C_LANG_SUPPORT
, SYSCONF
},
674 #ifdef _SC_C_LANG_SUPPORT_R
675 { "_POSIX_C_LANG_SUPPORT_R", _SC_C_LANG_SUPPORT_R
, SYSCONF
},
677 #ifdef _SC_CLOCK_SELECTION
678 { "_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION
, SYSCONF
},
681 { "_POSIX_CPUTIME", _SC_CPUTIME
, SYSCONF
},
683 #ifdef _SC_THREAD_CPUTIME
684 { "_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME
, SYSCONF
},
686 #ifdef _SC_DEVICE_SPECIFIC
687 { "_POSIX_DEVICE_SPECIFIC", _SC_DEVICE_SPECIFIC
, SYSCONF
},
689 #ifdef _SC_DEVICE_SPECIFIC_R
690 { "_POSIX_DEVICE_SPECIFIC_R", _SC_DEVICE_SPECIFIC_R
, SYSCONF
},
693 { "_POSIX_FD_MGMT", _SC_FD_MGMT
, SYSCONF
},
696 { "_POSIX_FIFO", _SC_FIFO
, SYSCONF
},
699 { "_POSIX_PIPE", _SC_PIPE
, SYSCONF
},
701 #ifdef _SC_FILE_ATTRIBUTES
702 { "_POSIX_FILE_ATTRIBUTES", _SC_FILE_ATTRIBUTES
, SYSCONF
},
704 #ifdef _SC_FILE_LOCKING
705 { "_POSIX_FILE_LOCKING", _SC_FILE_LOCKING
, SYSCONF
},
707 #ifdef _SC_FILE_SYSTEM
708 { "_POSIX_FILE_SYSTEM", _SC_FILE_SYSTEM
, SYSCONF
},
710 #ifdef _SC_MONOTONIC_CLOCK
711 { "_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK
, SYSCONF
},
713 #ifdef _SC_MULTI_PROCESS
714 { "_POSIX_MULTI_PROCESS", _SC_MULTI_PROCESS
, SYSCONF
},
716 #ifdef _SC_SINGLE_PROCESS
717 { "_POSIX_SINGLE_PROCESS", _SC_SINGLE_PROCESS
, SYSCONF
},
719 #ifdef _SC_NETWORKING
720 { "_POSIX_NETWORKING", _SC_NETWORKING
, SYSCONF
},
722 #ifdef _SC_READER_WRITER_LOCKS
723 { "_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS
, SYSCONF
},
725 #ifdef _SC_SPIN_LOCKS
726 { "_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS
, SYSCONF
},
729 { "_POSIX_REGEXP", _SC_REGEXP
, SYSCONF
},
731 #ifdef _SC_REGEX_VERSION
732 { "_REGEX_VERSION", _SC_REGEX_VERSION
, SYSCONF
},
735 { "_POSIX_SHELL", _SC_SHELL
, SYSCONF
},
738 { "_POSIX_SIGNALS", _SC_SIGNALS
, SYSCONF
},
741 { "_POSIX_SPAWN", _SC_SPAWN
, SYSCONF
},
743 #ifdef _SC_SPORADIC_SERVER
744 { "_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER
, SYSCONF
},
746 #ifdef _SC_THREAD_SPORADIC_SERVER
747 { "_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER
, SYSCONF
},
749 #ifdef _SC_SYSTEM_DATABASE
750 { "_POSIX_SYSTEM_DATABASE", _SC_SYSTEM_DATABASE
, SYSCONF
},
752 #ifdef _SC_SYSTEM_DATABASE_R
753 { "_POSIX_SYSTEM_DATABASE_R", _SC_SYSTEM_DATABASE_R
, SYSCONF
},
756 { "_POSIX_TIMEOUTS", _SC_TIMEOUTS
, SYSCONF
},
758 #ifdef _SC_TYPED_MEMORY_OBJECTS
759 { "_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS
, SYSCONF
},
761 #ifdef _SC_USER_GROUPS
762 { "_POSIX_USER_GROUPS", _SC_USER_GROUPS
, SYSCONF
},
764 #ifdef _SC_USER_GROUPS_R
765 { "_POSIX_USER_GROUPS_R", _SC_USER_GROUPS_R
, SYSCONF
},
768 { "POSIX2_PBS", _SC_2_PBS
, SYSCONF
},
770 #ifdef _SC_2_PBS_ACCOUNTING
771 { "POSIX2_PBS_ACCOUNTING", _SC_2_PBS_ACCOUNTING
, SYSCONF
},
773 #ifdef _SC_2_PBS_LOCATE
774 { "POSIX2_PBS_LOCATE", _SC_2_PBS_LOCATE
, SYSCONF
},
776 #ifdef _SC_2_PBS_TRACK
777 { "POSIX2_PBS_TRACK", _SC_2_PBS_TRACK
, SYSCONF
},
779 #ifdef _SC_2_PBS_MESSAGE
780 { "POSIX2_PBS_MESSAGE", _SC_2_PBS_MESSAGE
, SYSCONF
},
782 #ifdef _SC_SYMLOOP_MAX
783 { "SYMLOOP_MAX", _SC_SYMLOOP_MAX
, SYSCONF
},
785 #ifdef _SC_STREAM_MAX
786 { "STREAM_MAX", _SC_STREAM_MAX
, SYSCONF
},
788 #ifdef _SC_AIO_LISTIO_MAX
789 { "AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX
, SYSCONF
},
792 { "AIO_MAX", _SC_AIO_MAX
, SYSCONF
},
794 #ifdef _SC_AIO_PRIO_DELTA_MAX
795 { "AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX
, SYSCONF
},
797 #ifdef _SC_DELAYTIMER_MAX
798 { "DELAYTIMER_MAX", _SC_DELAYTIMER_MAX
, SYSCONF
},
800 #ifdef _SC_HOST_NAME_MAX
801 { "HOST_NAME_MAX", _SC_HOST_NAME_MAX
, SYSCONF
},
803 #ifdef _SC_LOGIN_NAME_MAX
804 { "LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX
, SYSCONF
},
806 #ifdef _SC_MQ_OPEN_MAX
807 { "MQ_OPEN_MAX", _SC_MQ_OPEN_MAX
, SYSCONF
},
809 #ifdef _SC_MQ_PRIO_MAX
810 { "MQ_PRIO_MAX", _SC_MQ_PRIO_MAX
, SYSCONF
},
813 { "_POSIX_DEVICE_IO", _SC_DEVICE_IO
, SYSCONF
},
816 { "_POSIX_TRACE", _SC_TRACE
, SYSCONF
},
818 #ifdef _SC_TRACE_EVENT_FILTER
819 { "_POSIX_TRACE_EVENT_FILTER", _SC_TRACE_EVENT_FILTER
, SYSCONF
},
821 #ifdef _SC_TRACE_INHERIT
822 { "_POSIX_TRACE_INHERIT", _SC_TRACE_INHERIT
, SYSCONF
},
825 { "_POSIX_TRACE_LOG", _SC_TRACE_LOG
, SYSCONF
},
828 { "RTSIG_MAX", _SC_RTSIG_MAX
, SYSCONF
},
830 #ifdef _SC_SEM_NSEMS_MAX
831 { "SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX
, SYSCONF
},
833 #ifdef _SC_SEM_VALUE_MAX
834 { "SEM_VALUE_MAX", _SC_SEM_VALUE_MAX
, SYSCONF
},
836 #ifdef _SC_SIGQUEUE_MAX
837 { "SIGQUEUE_MAX", _SC_SIGQUEUE_MAX
, SYSCONF
},
839 #ifdef _PC_FILESIZEBITS
840 { "FILESIZEBITS", _PC_FILESIZEBITS
, PATHCONF
},
842 #ifdef _PC_ALLOC_SIZE_MIN
843 { "POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN
, PATHCONF
},
845 #ifdef _PC_REC_INCR_XFER_SIZE
846 { "POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE
, PATHCONF
},
848 #ifdef _PC_REC_MAX_XFER_SIZE
849 { "POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE
, PATHCONF
},
851 #ifdef _PC_REC_MIN_XFER_SIZE
852 { "POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE
, PATHCONF
},
854 #ifdef _PC_REC_XFER_ALIGN
855 { "POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN
, PATHCONF
},
857 #ifdef _PC_SYMLINK_MAX
858 { "SYMLINK_MAX", _PC_SYMLINK_MAX
, PATHCONF
},
860 #ifdef _CS_GNU_LIBC_VERSION
861 { "GNU_LIBC_VERSION", _CS_GNU_LIBC_VERSION
, CONFSTR
},
863 #ifdef _CS_GNU_LIBPTHREAD_VERSION
864 { "GNU_LIBPTHREAD_VERSION", _CS_GNU_LIBPTHREAD_VERSION
, CONFSTR
},
866 #ifdef _PC_2_SYMLINKS
867 { "POSIX2_SYMLINKS", _PC_2_SYMLINKS
, PATHCONF
},
870 #ifdef _SC_LEVEL1_ICACHE_SIZE
871 { "LEVEL1_ICACHE_SIZE", _SC_LEVEL1_ICACHE_SIZE
, SYSCONF
},
873 #ifdef _SC_LEVEL1_ICACHE_ASSOC
874 { "LEVEL1_ICACHE_ASSOC", _SC_LEVEL1_ICACHE_ASSOC
, SYSCONF
},
876 #ifdef _SC_LEVEL1_ICACHE_LINESIZE
877 { "LEVEL1_ICACHE_LINESIZE", _SC_LEVEL1_ICACHE_LINESIZE
, SYSCONF
},
879 #ifdef _SC_LEVEL1_DCACHE_SIZE
880 { "LEVEL1_DCACHE_SIZE", _SC_LEVEL1_DCACHE_SIZE
, SYSCONF
},
882 #ifdef _SC_LEVEL1_DCACHE_ASSOC
883 { "LEVEL1_DCACHE_ASSOC", _SC_LEVEL1_DCACHE_ASSOC
, SYSCONF
},
885 #ifdef _SC_LEVEL1_DCACHE_LINESIZE
886 { "LEVEL1_DCACHE_LINESIZE", _SC_LEVEL1_DCACHE_LINESIZE
, SYSCONF
},
888 #ifdef _SC_LEVEL2_CACHE_SIZE
889 { "LEVEL2_CACHE_SIZE", _SC_LEVEL2_CACHE_SIZE
, SYSCONF
},
891 #ifdef _SC_LEVEL2_CACHE_ASSOC
892 { "LEVEL2_CACHE_ASSOC", _SC_LEVEL2_CACHE_ASSOC
, SYSCONF
},
894 #ifdef _SC_LEVEL2_CACHE_LINESIZE
895 { "LEVEL2_CACHE_LINESIZE", _SC_LEVEL2_CACHE_LINESIZE
, SYSCONF
},
897 #ifdef _SC_LEVEL3_CACHE_SIZE
898 { "LEVEL3_CACHE_SIZE", _SC_LEVEL3_CACHE_SIZE
, SYSCONF
},
900 #ifdef _SC_LEVEL3_CACHE_ASSOC
901 { "LEVEL3_CACHE_ASSOC", _SC_LEVEL3_CACHE_ASSOC
, SYSCONF
},
903 #ifdef _SC_LEVEL3_CACHE_LINESIZE
904 { "LEVEL3_CACHE_LINESIZE", _SC_LEVEL3_CACHE_LINESIZE
, SYSCONF
},
906 #ifdef _SC_LEVEL4_CACHE_SIZE
907 { "LEVEL4_CACHE_SIZE", _SC_LEVEL4_CACHE_SIZE
, SYSCONF
},
909 #ifdef _SC_LEVEL4_CACHE_ASSOC
910 { "LEVEL4_CACHE_ASSOC", _SC_LEVEL4_CACHE_ASSOC
, SYSCONF
},
914 { "IPV6", _SC_IPV6
, SYSCONF
},
916 #ifdef _SC_RAW_SOCKETS
917 { "RAW_SOCKETS", _SC_RAW_SOCKETS
, SYSCONF
},
924 static struct { const char *name
; int num
; } specs
[] =
926 { "POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32
},
927 { "POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG
},
928 { "POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64
},
929 { "POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG
}
931 static const int nspecs
= sizeof (specs
) / sizeof (specs
[0]);
933 extern const char *__progname
;
940 _("Usage: %s [-v specification] variable_name [pathname]\n"),
943 _(" %s -a [pathname]\n"), __progname
);
948 print_all (const char *path
)
950 register const struct conf
*c
;
954 for (c
= vars
; c
->name
!= NULL
; ++c
) {
955 printf("%-35s", c
->name
);
958 value
= pathconf (path
, c
->call_name
);
960 printf("%ld", value
);
965 value
= sysconf (c
->call_name
);
967 if (c
->call_name
== _SC_UINT_MAX
968 || c
->call_name
== _SC_ULONG_MAX
)
969 printf ("%lu", value
);
972 printf ("%ld", value
);
977 clen
= confstr (c
->call_name
, (char *) NULL
, 0);
978 cvalue
= (char *) malloc (clen
);
980 error (3, 0, _("memory exhausted"));
981 if (confstr (c
->call_name
, cvalue
, clen
) != clen
)
982 error (3, errno
, "confstr");
983 printf ("%.*s\n", (int) clen
, cvalue
);
992 main (int argc
, char *argv
[])
994 register const struct conf
*c
;
996 /* Set locale. Do not set LC_ALL because the other categories must
997 not be affected (according to POSIX.2). */
998 setlocale (LC_CTYPE
, "");
999 setlocale (LC_MESSAGES
, "");
1001 /* Initialize the message catalog. */
1002 textdomain (PACKAGE
);
1004 if (argc
> 1 && strcmp (argv
[1], "--version") == 0)
1006 fprintf (stderr
, "getconf (GNU %s) %s\n", PACKAGE
, VERSION
);
1007 fprintf (stderr
, gettext ("\
1008 Copyright (C) %s Free Software Foundation, Inc.\n\
1009 This is free software; see the source for copying conditions. There is NO\n\
1010 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
1012 fprintf (stderr
, gettext ("Written by %s.\n"), "Roland McGrath");
1016 const char *getconf_dir
= getenv ("GETCONF_DIR") ?: GETCONF_DIR
;
1017 size_t getconf_dirlen
= strlen (getconf_dir
);
1019 const char *spec
= NULL
;
1020 char buf
[sizeof "POSIX_V6_LPBIG_OFFBIG"];
1021 char *argv0
= argv
[0];
1022 if (argc
> 1 && strncmp (argv
[1], "-v", 2) == 0)
1024 if (argv
[1][2] == '\0')
1042 char default_name
[getconf_dirlen
+ sizeof "/default"];
1043 memcpy (mempcpy (default_name
, getconf_dir
, getconf_dirlen
),
1044 "/default", sizeof "/default");
1045 int len
= readlink (default_name
, buf
, sizeof buf
- 1);
1053 /* Check for the specifications we know. */
1057 for (i
= 0; i
< nspecs
; ++i
)
1058 if (strcmp (spec
, specs
[i
].name
) == 0)
1062 error (2, 0, _("unknown specification \"%s\""), spec
);
1064 switch (specs
[i
].num
)
1066 #ifndef _POSIX_V6_ILP32_OFF32
1067 case _SC_V6_ILP32_OFF32
:
1069 #ifndef _POSIX_V6_ILP32_OFFBIG
1070 case _SC_V6_ILP32_OFFBIG
:
1072 #ifndef _POSIX_V6_LP64_OFF64
1073 case _SC_V6_LP64_OFF64
:
1075 #ifndef _POSIX_V6_LPBIG_OFFBIG
1076 case _SC_V6_LPBIG_OFFBIG
:
1079 const char *args
[argc
+ 3];
1080 size_t spec_len
= strlen (spec
);
1081 char getconf_name
[getconf_dirlen
+ 1 + spec_len
+ 1];
1082 memcpy (mempcpy (mempcpy (getconf_name
, getconf_dir
,
1084 "/", 1), spec
, spec_len
+ 1);
1088 memcpy (&args
[3], &argv
[1], argc
* sizeof (argv
[1]));
1089 execv (getconf_name
, (char * const *) args
);
1090 error (4, errno
, _("Couldn't execute %s"), getconf_name
);
1097 if (argc
> 1 && strcmp (argv
[1], "-a") == 0)
1102 print_all (argv
[2]);
1107 if (argc
< 2 || argc
> 3)
1110 for (c
= vars
; c
->name
!= NULL
; ++c
)
1111 if (strcmp (c
->name
, argv
[1]) == 0
1112 || (strncmp (c
->name
, "_POSIX_", 7) == 0
1113 && strcmp (c
->name
+ 7, argv
[1]) == 0))
1124 value
= pathconf (argv
[2], c
->call_name
);
1128 error (3, errno
, "pathconf: %s", argv
[2]);
1130 puts (_("undefined"));
1133 printf ("%ld\n", value
);
1139 value
= sysconf (c
->call_name
);
1142 if (c
->call_name
== _SC_UINT_MAX
1143 || c
->call_name
== _SC_ULONG_MAX
)
1144 printf ("%lu\n", value
);
1146 puts (_("undefined"));
1149 printf ("%ld\n", value
);
1155 clen
= confstr (c
->call_name
, (char *) NULL
, 0);
1156 cvalue
= (char *) malloc (clen
);
1158 error (3, 0, _("memory exhausted"));
1160 if (confstr (c
->call_name
, cvalue
, clen
) != clen
)
1161 error (3, errno
, "confstr");
1163 printf ("%.*s\n", (int) clen
, cvalue
);
1168 error (2, 0, _("Unrecognized variable `%s'"), argv
[1]);