1 /* Copyright (C) 1991,1993,1995-1997,2001,2002,2003
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 #include <sys/param.h>
28 #include <sys/sysinfo.h>
31 /* Get the value of the system variable NAME. */
43 return MAX (__tzname_max (), _POSIX_TZNAME_MAX
);
45 case _SC_CHARCLASS_NAME_MAX
:
46 #ifdef CHARCLASS_NAME_MAX
47 return CHARCLASS_NAME_MAX
;
52 case _SC_COLL_WEIGHTS_MAX
:
53 #ifdef COLL_WEIGHTS_MAX
54 return COLL_WEIGHTS_MAX
;
59 case _SC_EQUIV_CLASS_MAX
:
60 #ifdef EQUIV_CLASS_MAX
61 return EQUIV_CLASS_MAX
;
67 #ifdef _POSIX2_LOCALEDEF
68 return _POSIX2_LOCALEDEF
;
73 case _SC_NPROCESSORS_CONF
:
74 return __get_nprocs_conf ();
76 case _SC_NPROCESSORS_ONLN
:
77 return __get_nprocs ();
80 return __get_phys_pages ();
82 case _SC_AVPHYS_PAGES
:
83 return __get_avphys_pages ();
86 /* We have no limit since we use lists. */
90 /* We have no limit but since the return value might be used to
91 allocate a buffer we restrict the value. */
110 return sizeof (long int) * CHAR_BIT
;
113 return sizeof (int) * CHAR_BIT
;
122 return _POSIX_SSIZE_MAX
;
148 case _SC_GETGR_R_SIZE_MAX
:
149 return NSS_BUFLEN_GROUP
;
151 case _SC_GETPW_R_SIZE_MAX
:
152 return NSS_BUFLEN_PASSWD
;
157 case _SC_NGROUPS_MAX
:
160 case _SC_JOB_CONTROL
:
162 case _SC_REALTIME_SIGNALS
:
163 case _SC_PRIORITY_SCHEDULING
:
165 case _SC_ASYNCHRONOUS_IO
:
166 case _SC_PRIORITIZED_IO
:
167 case _SC_SYNCHRONIZED_IO
:
169 case _SC_MAPPED_FILES
:
171 case _SC_MEMLOCK_RANGE
:
172 case _SC_MEMORY_PROTECTION
:
173 case _SC_MESSAGE_PASSING
:
175 case _SC_SHARED_MEMORY_OBJECTS
:
177 case _SC_AIO_LISTIO_MAX
:
179 case _SC_AIO_PRIO_DELTA_MAX
:
180 case _SC_DELAYTIMER_MAX
:
181 case _SC_MQ_OPEN_MAX
:
182 case _SC_MQ_PRIO_MAX
:
186 case _SC_SEM_NSEMS_MAX
:
187 case _SC_SEM_VALUE_MAX
:
188 case _SC_SIGQUEUE_MAX
:
198 case _SC_PII_INTERNET_STREAM
:
199 case _SC_PII_INTERNET_DGRAM
:
200 case _SC_PII_OSI_COTS
:
201 case _SC_PII_OSI_CLTS
:
205 case _SC_BC_BASE_MAX
:
207 case _SC_BC_SCALE_MAX
:
208 case _SC_BC_STRING_MAX
:
209 case _SC_EXPR_NEST_MAX
:
217 case _SC_2_CHAR_TERM
:
218 case _SC_2_C_VERSION
:
222 case _SC_THREAD_SAFE_FUNCTIONS
:
223 case _SC_LOGIN_NAME_MAX
:
224 case _SC_TTY_NAME_MAX
:
225 case _SC_THREAD_DESTRUCTOR_ITERATIONS
:
226 case _SC_THREAD_KEYS_MAX
:
227 case _SC_THREAD_STACK_MIN
:
228 case _SC_THREAD_THREADS_MAX
:
229 case _SC_THREAD_ATTR_STACKADDR
:
230 case _SC_THREAD_ATTR_STACKSIZE
:
231 case _SC_THREAD_PRIORITY_SCHEDULING
:
232 case _SC_THREAD_PRIO_INHERIT
:
233 case _SC_THREAD_PRIO_PROTECT
:
234 case _SC_THREAD_PROCESS_SHARED
:
236 case _SC_XOPEN_VERSION
:
237 case _SC_XOPEN_XCU_VERSION
:
239 case _SC_XOPEN_CRYPT
:
240 case _SC_XOPEN_ENH_I18N
:
253 case _SC_XBS5_ILP32_OFF32
:
254 case _SC_XBS5_ILP32_OFFBIG
:
255 case _SC_XBS5_LP64_OFF64
:
256 case _SC_XBS5_LPBIG_OFFBIG
:
258 case _SC_XOPEN_LEGACY
:
259 case _SC_XOPEN_REALTIME
:
260 case _SC_XOPEN_REALTIME_THREADS
:
265 __set_errno (ENOSYS
);
269 weak_alias (__sysconf
, sysconf
)
270 libc_hidden_def (__sysconf
)
272 stub_warning (sysconf
)
273 #include <stub-tag.h>