1 /* Copyright (C) 1991, 92, 95, 96, 97, 98, 99 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 Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
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
},
368 #ifdef _SC_TZNAME_MAX
369 { "_POSIX_TZNAME_MAX", _SC_TZNAME_MAX
, SYSCONF
},
372 { "_POSIX_VERSION", _SC_VERSION
, SYSCONF
},
375 { "_T_IOV_MAX", _SC_T_IOV_MAX
, SYSCONF
},
377 #ifdef _SC_XOPEN_CRYPT
378 { "_XOPEN_CRYPT", _SC_XOPEN_CRYPT
, SYSCONF
},
380 #ifdef _SC_XOPEN_ENH_I18N
381 { "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N
, SYSCONF
},
383 #ifdef _SC_XOPEN_LEGACY
384 { "_XOPEN_LEGACY", _SC_XOPEN_LEGACY
, SYSCONF
},
386 #ifdef _SC_XOPEN_REALTIME
387 { "_XOPEN_REALTIME", _SC_XOPEN_REALTIME
, SYSCONF
},
389 #ifdef _SC_XOPEN_REALTIME_THREADS
390 { "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS
, SYSCONF
},
393 { "_XOPEN_SHM", _SC_XOPEN_SHM
, SYSCONF
},
395 #ifdef _SC_XOPEN_UNIX
396 { "_XOPEN_UNIX", _SC_XOPEN_UNIX
, SYSCONF
},
398 #ifdef _SC_XOPEN_VERSION
399 { "_XOPEN_VERSION", _SC_XOPEN_VERSION
, SYSCONF
},
401 #ifdef _SC_XOPEN_XCU_VERSION
402 { "_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION
, SYSCONF
},
404 #ifdef _SC_XOPEN_XPG2
405 { "_XOPEN_XPG2", _SC_XOPEN_XPG2
, SYSCONF
},
407 #ifdef _SC_XOPEN_XPG3
408 { "_XOPEN_XPG3", _SC_XOPEN_XPG3
, SYSCONF
},
410 #ifdef _SC_XOPEN_XPG4
411 { "_XOPEN_XPG4", _SC_XOPEN_XPG4
, SYSCONF
},
414 #ifdef _SC_BC_BASE_MAX
415 { "BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
417 #ifdef _SC_BC_DIM_MAX
418 { "BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
420 #ifdef _SC_BC_SCALE_MAX
421 { "BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
423 #ifdef _SC_BC_STRING_MAX
424 { "BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
426 { "CHARCLASS_NAME_MAX", _SC_CHARCLASS_NAME_MAX
, SYSCONF
},
427 #ifdef _SC_COLL_WEIGHTS_MAX
428 { "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
430 #ifdef _SC_EQUIV_CLASS_MAX
431 { "EQUIV_CLASS_MAX", _SC_EQUIV_CLASS_MAX
, SYSCONF
},
433 #ifdef _SC_EXPR_NEST_MAX
434 { "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
437 { "LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
439 #ifdef _SC_BC_BASE_MAX
440 { "POSIX2_BC_BASE_MAX", _SC_BC_BASE_MAX
, SYSCONF
},
442 #ifdef _SC_BC_DIM_MAX
443 { "POSIX2_BC_DIM_MAX", _SC_BC_DIM_MAX
, SYSCONF
},
445 #ifdef _SC_BC_SCALE_MAX
446 { "POSIX2_BC_SCALE_MAX", _SC_BC_SCALE_MAX
, SYSCONF
},
448 #ifdef _SC_BC_STRING_MAX
449 { "POSIX2_BC_STRING_MAX", _SC_BC_STRING_MAX
, SYSCONF
},
451 #ifdef _SC_2_CHAR_TERM
452 { "POSIX2_CHAR_TERM", _SC_2_CHAR_TERM
, SYSCONF
},
454 #ifdef _SC_COLL_WEIGHTS_MAX
455 { "POSIX2_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX
, SYSCONF
},
458 { "POSIX2_C_BIND", _SC_2_C_BIND
, SYSCONF
},
461 { "POSIX2_C_DEV", _SC_2_C_DEV
, SYSCONF
},
463 #ifdef _SC_2_C_VERSION
464 { "POSIX2_C_VERSION", _SC_2_C_VERSION
, SYSCONF
},
466 #ifdef _SC_EXPR_NEST_MAX
467 { "POSIX2_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX
, SYSCONF
},
469 #ifdef _SC_2_FORT_DEV
470 { "POSIX2_FORT_DEV", _SC_2_FORT_DEV
, SYSCONF
},
472 #ifdef _SC_2_FORT_RUN
473 { "POSIX2_FORT_RUN", _SC_2_FORT_RUN
, SYSCONF
},
476 { "POSIX2_LINE_MAX", _SC_LINE_MAX
, SYSCONF
},
478 #ifdef _SC_2_LOCALEDEF
479 { "POSIX2_LOCALEDEF", _SC_2_LOCALEDEF
, SYSCONF
},
481 #ifdef _SC_RE_DUP_MAX
482 { "POSIX2_RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
485 { "POSIX2_SW_DEV", _SC_2_SW_DEV
, SYSCONF
},
488 { "POSIX2_UPE", _SC_2_UPE
, SYSCONF
},
491 { "POSIX2_VERSION", _SC_2_VERSION
, SYSCONF
},
493 #ifdef _SC_RE_DUP_MAX
494 { "RE_DUP_MAX", _SC_RE_DUP_MAX
, SYSCONF
},
498 { "PATH", _CS_PATH
, CONFSTR
},
501 { "CS_PATH", _CS_PATH
, CONFSTR
},
505 #ifdef _CS_LFS_CFLAGS
506 { "LFS_CFLAGS", _CS_LFS_CFLAGS
, CONFSTR
},
508 #ifdef _CS_LFS_LDFLAGS
509 { "LFS_LDFLAGS", _CS_LFS_LDFLAGS
, CONFSTR
},
512 { "LFS_LIBS", _CS_LFS_LIBS
, CONFSTR
},
514 #ifdef _CS_LFS_LINTFLAGS
515 { "LFS_LINTFLAGS", _CS_LFS_LINTFLAGS
, CONFSTR
},
517 #ifdef _CS_LFS64_CFLAGS
518 { "LFS64_CFLAGS", _CS_LFS64_CFLAGS
, CONFSTR
},
520 #ifdef _CS_LFS64_LDFLAGS
521 { "LFS64_LDFLAGS", _CS_LFS64_LDFLAGS
, CONFSTR
},
523 #ifdef _CS_LFS64_LIBS
524 { "LFS64_LIBS", _CS_LFS64_LIBS
, CONFSTR
},
526 #ifdef _CS_LFS64_LINTFLAGS
527 { "LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS
, CONFSTR
},
530 /* Programming environments. */
531 #ifdef _SC_XBS5_ILP32_OFF32
532 { "XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32
, SYSCONF
},
534 #ifdef _CS_XBS5_ILP32_OFF32_CFLAGS
535 { "XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS
, CONFSTR
},
537 #ifdef _CS_XBS5_ILP32_OFF32_LDFLAGS
538 { "XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS
, CONFSTR
},
540 #ifdef _CS_XBS5_ILP32_OFF32_LIBS
541 { "XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS
, CONFSTR
},
543 #ifdef _CS_XBS5_ILP32_OFF32_LINTFLAGS
544 { "XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS
, CONFSTR
},
547 #ifdef _SC_XBS5_ILP32_OFFBIG
548 { "XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG
, SYSCONF
},
550 #ifdef _CS_XBS5_ILP32_OFFBIG_CFLAGS
551 { "XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS
, CONFSTR
},
553 #ifdef _CS_XBS5_ILP32_OFFBIG_LDFLAGS
554 { "XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS
, CONFSTR
},
556 #ifdef _CS_XBS5_ILP32_OFFBIG_LIBS
557 { "XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS
, CONFSTR
},
559 #ifdef _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
560 { "XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
, CONFSTR
},
563 #ifdef _SC_XBS5_LP64_OFF64
564 { "XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64
, SYSCONF
},
566 #ifdef _CS_XBS5_LP64_OFF64_CFLAGS
567 { "XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS
, CONFSTR
},
569 #ifdef _CS_XBS5_LP64_OFF64_LDFLAGS
570 { "XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS
, CONFSTR
},
572 #ifdef _CS_XBS5_LP64_OFF64_LIBS
573 { "XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS
, CONFSTR
},
575 #ifdef _CS_XBS5_LP64_OFF64_LINTFLAGS
576 { "XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS
, CONFSTR
},
579 #ifdef _SC_XBS5_LPBIG_OFFBIG
580 { "XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG
, SYSCONF
},
582 #ifdef _CS_XBS5_LPBIG_OFFBIG_CFLAGS
583 { "XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS
, CONFSTR
},
585 #ifdef _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
586 { "XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
, CONFSTR
},
588 #ifdef _CS_XBS5_LPBIG_OFFBIG_LIBS
589 { "XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS
, CONFSTR
},
591 #ifdef _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
592 { "XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
, CONFSTR
},
598 extern const char *__progname
;
604 fprintf (stderr
, _("Usage: %s variable_name [pathname]\n"), __progname
);
609 main (int argc
, char *argv
[])
611 register const struct conf
*c
;
613 /* Set locale. Do not set LC_ALL because the other categories must
614 not be affected (according to POSIX.2). */
615 setlocale (LC_CTYPE
, "");
616 setlocale (LC_MESSAGES
, "");
618 /* Initialize the message catalog. */
619 textdomain (PACKAGE
);
621 if (argc
> 1 && strcmp (argv
[1], "--version") == 0)
623 fprintf (stderr
, "getconf (GNU %s) %s\n", PACKAGE
, VERSION
);
624 fprintf (stderr
, gettext ("\
625 Copyright (C) %s Free Software Foundation, Inc.\n\
626 This is free software; see the source for copying conditions. There is NO\n\
627 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
629 fprintf (stderr
, gettext ("Written by %s.\n"), "Roland McGrath");
633 if (argc
< 2 || argc
> 3)
636 for (c
= vars
; c
->name
!= NULL
; ++c
)
637 if (!strcmp (c
->name
, argv
[1]))
648 value
= pathconf (argv
[2], c
->call_name
);
652 error (3, errno
, "pathconf: %s", argv
[2]);
654 puts (_("undefined"));
657 printf ("%ld\n", value
);
663 value
= sysconf (c
->call_name
);
666 if (c
->call_name
== _SC_UINT_MAX
667 || c
->call_name
== _SC_ULONG_MAX
)
668 printf ("%lu\n", value
);
670 puts (_("undefined"));
673 printf ("%ld\n", value
);
679 clen
= confstr (c
->call_name
, (char *) NULL
, 0);
680 cvalue
= (char *) malloc (clen
);
682 error (3, 0, _("memory exhausted"));
684 if (confstr (c
->call_name
, cvalue
, clen
) != clen
)
685 error (3, errno
, "confstr");
687 printf ("%.*s\n", (int) clen
, cvalue
);
692 error (2, 0, _("Unrecognized variable `%s'"), argv
[1]);