Wed Jul 3 16:29:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
[glibc.git] / sysdeps / stub / sysconf.c
blob816724ef52ccd9895b69e6775d2a0b9ad6f28ed2
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. */
19 #include <ansidecl.h>
20 #include <errno.h>
21 #include <unistd.h>
22 #include <time.h>
23 #include <limits.h>
26 /* Get the value of the system variable NAME. */
27 long int
28 DEFUN(__sysconf, (name), int name)
30 switch (name)
32 default:
33 errno = EINVAL;
34 return -1;
36 case _SC_TZNAME_MAX:
37 return __tzname_max ();
39 case _SC_ARG_MAX:
40 case _SC_CHILD_MAX:
41 case _SC_CLK_TCK:
42 case _SC_NGROUPS_MAX:
43 case _SC_OPEN_MAX:
44 case _SC_JOB_CONTROL:
45 case _SC_SAVED_IDS:
46 case _SC_REALTIME_SIGNALS:
47 case _SC_PRIORITY_SCHEDULING:
48 case _SC_TIMERS:
49 case _SC_ASYNCHRONOUS_IO:
50 case _SC_PRIORITIZED_IO:
51 case _SC_SYNCHRONIZED_IO:
52 case _SC_FSYNC:
53 case _SC_MAPPED_FILES:
54 case _SC_MEMLOCK:
55 case _SC_MEMLOCK_RANGE:
56 case _SC_MEMORY_PROTECTION:
57 case _SC_MESSAGE_PASSING:
58 case _SC_SEMAPHORES:
59 case _SC_SHARED_MEMORY_OBJECTS:
60 case _SC_VERSION:
62 case _SC_PII:
63 case _SC_PII_XTI:
64 case _SC_PII_SOCKET:
65 case _SC_PII_OSI:
66 case _SC_POLL:
67 case _SC_SELECT:
68 case _SC_UIO_MAXIOV:
69 case _SC_PII_INTERNET_STREAM:
70 case _SC_PII_INTERNET_DGRAM:
71 case _SC_PII_OSI_COTS:
72 case _SC_PII_OSI_CLTS:
73 case _SC_PII_OSI_M:
74 case _SC_T_IOV_MAX:
76 case _SC_BC_BASE_MAX:
77 case _SC_BC_DIM_MAX:
78 case _SC_BC_SCALE_MAX:
79 case _SC_BC_STRING_MAX:
80 case _SC_EQUIV_CLASS_MAX:
81 case _SC_EXPR_NEST_MAX:
82 case _SC_LINE_MAX:
83 case _SC_RE_DUP_MAX:
84 case _SC_CHARCLASS_NAME_MAX:
85 case _SC_2_VERSION:
86 case _SC_2_C_BIND:
87 case _SC_2_C_DEV:
88 case _SC_2_FORT_DEV:
89 case _SC_2_SW_DEV:
91 break;
94 errno = ENOSYS;
95 return -1;
98 weak_alias (__sysconf, sysconf)
100 stub_warning (sysconf)