Line | |
---|
1 | /* sysconf.c POSIX 4.8.1
|
---|
2 | * long int sysconf(int name);
|
---|
3 | *
|
---|
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 | */
|
---|
9 |
|
---|
10 | #include <lib.h>
|
---|
11 | #include <unistd.h>
|
---|
12 | #include <time.h>
|
---|
13 |
|
---|
14 | PUBLIC long int sysconf(name)
|
---|
15 | int name; /* property being inspected */
|
---|
16 | {
|
---|
17 | switch(name) {
|
---|
18 | case _SC_ARG_MAX:
|
---|
19 | return (long) ARG_MAX;
|
---|
20 |
|
---|
21 | case _SC_CHILD_MAX:
|
---|
22 | return (long) CHILD_MAX;
|
---|
23 |
|
---|
24 | case _SC_CLK_TCK:
|
---|
25 | return (long) CLOCKS_PER_SEC;
|
---|
26 |
|
---|
27 | case _SC_NGROUPS_MAX:
|
---|
28 | return (long) NGROUPS_MAX;
|
---|
29 |
|
---|
30 | case _SC_OPEN_MAX:
|
---|
31 | return (long) OPEN_MAX;
|
---|
32 |
|
---|
33 | case _SC_JOB_CONTROL:
|
---|
34 | return -1L; /* no job control */
|
---|
35 |
|
---|
36 | case _SC_SAVED_IDS:
|
---|
37 | return -1L; /* no saved uid/gid */
|
---|
38 |
|
---|
39 | case _SC_VERSION:
|
---|
40 | return (long) _POSIX_VERSION;
|
---|
41 |
|
---|
42 | case _SC_STREAM_MAX:
|
---|
43 | return (long) STREAM_MAX;
|
---|
44 |
|
---|
45 | case _SC_TZNAME_MAX:
|
---|
46 | return (long) TZNAME_MAX;
|
---|
47 |
|
---|
48 | case _SC_PAGESIZE:
|
---|
49 | return getpagesize();
|
---|
50 |
|
---|
51 | default:
|
---|
52 | errno = EINVAL;
|
---|
53 | return -1L;
|
---|
54 | }
|
---|
55 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.