Uninitialized vector entry?
[minix3.git] / lib / other / sysconf.c
blob51d00dd8dc18dd394e8c0f4a3343fb5a9c99a534
1 /* sysconf.c POSIX 4.8.1
2 * long int sysconf(int name);
4 * POSIX allows some of the values in <limits.h> to be increased at
5 * run time. The sysconf() function allows such values to be checked
6 * at run time. MINIX does not use this facility - the run time
7 * limits are those given in <limits.h>.
8 */
10 #include <lib.h>
11 #include <unistd.h>
12 #include <time.h>
14 PUBLIC long int sysconf(name)
15 int name; /* property being inspected */
17 switch(name) {
18 case _SC_ARG_MAX:
19 return (long) ARG_MAX;
21 case _SC_CHILD_MAX:
22 return (long) CHILD_MAX;
24 case _SC_CLK_TCK:
25 return (long) CLOCKS_PER_SEC;
27 case _SC_NGROUPS_MAX:
28 return (long) NGROUPS_MAX;
30 case _SC_OPEN_MAX:
31 return (long) OPEN_MAX;
33 case _SC_JOB_CONTROL:
34 return -1L; /* no job control */
36 case _SC_SAVED_IDS:
37 return -1L; /* no saved uid/gid */
39 case _SC_VERSION:
40 return (long) _POSIX_VERSION;
42 case _SC_STREAM_MAX:
43 return (long) STREAM_MAX;
45 case _SC_TZNAME_MAX:
46 return (long) TZNAME_MAX;
48 case _SC_PAGESIZE:
49 return getpagesize();
51 default:
52 errno = EINVAL;
53 return -1L;