1 /* Copyright (C) 1991, 1993, 1995, 1996 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
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
28 extern int __getdtablesize
__P ((void));
29 extern size_t __getpagesize
__P ((void));
31 /* Get the value of the system variable NAME. */
71 return __getdtablesize ();
81 return __tzname_max ();
84 #ifdef _POSIX_JOB_CONTROL
91 #ifdef _POSIX_SAVED_IDS
97 case _SC_REALTIME_SIGNALS
:
98 #ifdef _POSIX_REALTIME_SIGNALS
104 case _SC_PRIORITY_SCHEDULING
:
105 #ifdef _POSIX_PRIORITY_SCHEDULING
118 case _SC_ASYNCHRONOUS_IO
:
119 #ifdef _POSIX_ASYNCHRONOUS_IO
125 case _SC_PRIORITIZED_IO
:
126 #ifdef _POSIX_PRIORITIZED_IO
132 case _SC_SYNCHRONIZED_IO
:
133 #ifdef _POSIX_SYNCHRONIZED_IO
146 case _SC_MAPPED_FILES
:
147 #ifdef _POSIX_MAPPED_FILES
154 #ifdef _POSIX_MEMLOCK
160 case _SC_MEMLOCK_RANGE
:
161 #ifdef _POSIX_MEMLOCK_RANGE
167 case _SC_MEMORY_PROTECTION
:
168 #ifdef _POSIX_MEMORY_PROTECTION
174 case _SC_MESSAGE_PASSING
:
175 #ifdef _POSIX_MESSAGE_PASSING
182 #ifdef _POSIX_SEMAPHORES
188 case _SC_SHARED_MEMORY_OBJECTS
:
189 #ifdef _POSIX_SHARED_MEMORY_OBJECTS
196 return _POSIX_VERSION
;
199 return __getpagesize ();
201 case _SC_AIO_LISTIO_MAX
:
202 #ifdef AIO_LISTIO_MAX
203 return AIO_LISTIO_MAX
;
215 case _SC_AIO_PRIO_DELTA_MAX
:
216 #ifdef AIO_PRIO_DELTA_MAX
217 return AIO_PRIO_DELTA_MAX
;
222 case _SC_DELAYTIMER_MAX
:
223 #ifdef DELAYTIMER_MAX
224 return DELAYTIMER_MAX
;
229 case _SC_MQ_OPEN_MAX
:
236 case _SC_MQ_PRIO_MAX
:
250 case _SC_SEM_NSEMS_MAX
:
252 return SEM_NSEMS_MAX
;
257 case _SC_SEM_VALUE_MAX
:
259 return SEM_VALUE_MAX
;
264 case _SC_SIGQUEUE_MAX
:
278 case _SC_BC_BASE_MAX
:
292 case _SC_BC_SCALE_MAX
:
299 case _SC_BC_STRING_MAX
:
301 return BC_STRING_MAX
;
306 case _SC_COLL_WEIGHTS_MAX
:
307 #ifdef COLL_WEIGHTS_MAX
308 return COLL_WEIGHTS_MAX
;
313 case _SC_EQUIV_CLASS_MAX
:
314 #ifdef EQUIV_CLASS_MAX
315 return EQUIV_CLASS_MAX
;
320 case _SC_EXPR_NEST_MAX
:
322 return EXPR_NEST_MAX
;
341 case _SC_CHARCLASS_NAME_MAX
:
342 #ifdef CHARCLASS_NAME_MAX
343 return CHARCLASS_NAME_MAX
;
356 #ifdef _POSIX_PII_XTI
363 #ifdef _POSIX_PII_SOCKET
369 case _SC_PII_INTERNET
:
370 #ifdef _POSIX_PII_INTERNET
377 #ifdef _POSIX_PII_OSI
404 case _SC_PII_INTERNET_STREAM
:
405 #ifdef _POSIX_PII_INTERNET_STREAM
411 case _SC_PII_INTERNET_DGRAM
:
412 #ifdef _POSIX_PII_INTERNET_DGRAM
418 case _SC_PII_OSI_COTS
:
419 #ifdef _POSIX_PII_OSI_COTS
425 case _SC_PII_OSI_CLTS
:
426 #ifdef _POSIX_PII_OSI_CLTS
433 #ifdef _POSIX_PII_OSI_M
447 /* This is actually supposed to return the version
448 of the 1003.2 utilities on the system {POSIX2_VERSION}. */
449 return _POSIX2_C_VERSION
;
452 #ifdef _POSIX2_C_BIND
453 return _POSIX2_C_BIND
;
460 return _POSIX2_C_DEV
;
466 #ifdef _POSIX2_FORT_DEV
467 return _POSIX2_FORT_DEV
;
472 case _SC_2_LOCALEDEF
:
473 #ifdef _POSIX2_LOCALEDEF
474 return _POSIX2_LOCALEDEF
;
480 #ifdef _POSIX2_SW_DEV
481 return _POSIX2_SW_DEV
;
486 /* POSIX 1003.1c (POSIX Threads). */
488 #ifdef _POSIX_THREADS
494 case _SC_THREAD_SAFE_FUNCTIONS
:
495 #ifdef _POSIX_THREAD_SAFE_FUNCTIONS
501 case _SC_GETGR_R_SIZE_MAX
:
502 #ifdef NSS_BUFLEN_GROUP
503 return NSS_BUFLEN_GROUP
;
508 case _SC_GETPW_R_SIZE_MAX
:
509 #ifdef NSS_BUFLEN_PASSWD
510 return NSS_BUFLEN_PASSWD
;
515 case _SC_LOGIN_NAME_MAX
:
516 #ifdef _POSIX_LOGIN_NAME_MAX
517 return _POSIX_LOGIN_NAME_MAX
;
522 case _SC_TTY_NAME_MAX
:
523 #ifdef _POSIX_TTY_NAME_MAX
524 return _POSIX_TTY_NAME_MAX
;
529 case _SC_THREAD_DESTRUCTOR_ITERATIONS
:
530 #ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS
531 return _POSIX_THREAD_DESTRUCTOR_ITERATIONS
;
536 case _SC_THREAD_KEYS_MAX
:
537 #ifdef PTHREAD_KEYS_MAX
538 return PTHREAD_KEYS_MAX
;
543 case _SC_THREAD_STACK_MIN
:
544 #ifdef PTHREAD_STACK_MIN
545 return PTHREAD_STACK_MIN
;
550 case _SC_THREAD_THREADS_MAX
:
551 #ifdef PTHREAD_THREADS_MAX
552 return PTHREAD_THREADS_MAX
;
557 case _SC_THREAD_ATTR_STACKADDR
:
558 #ifdef _POSIX_THREAD_ATTR_STACKADDR
564 case _SC_THREAD_ATTR_STACKSIZE
:
565 #ifdef _POSIX_THREAD_ATTR_STACKSIZE
571 case _SC_THREAD_PRIORITY_SCHEDULING
:
572 #ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
578 case _SC_THREAD_PRIO_INHERIT
:
579 #ifdef _POSIX_THREAD_PRIO_INHERIT
585 case _SC_THREAD_PRIO_PROTECT
:
586 #ifdef _POSIX_THREAD_PRIO_PROTECT
592 case _SC_THREAD_PROCESS_SHARED
:
593 #ifdef _POSIX_THREAD_PROCESS_SHARED
601 weak_alias (__sysconf
, sysconf
)