Rev | Author | # | Line |
---|---|---|---|
1 | perry | 1 | SYSCTL |
2 | !!!SYSCTL | ||
3 | NAME | ||
4 | SYNOPSIS | ||
5 | DESCRIPTION | ||
6 | EXAMPLE | ||
7 | RETURN VALUE | ||
8 | ERRORS | ||
9 | CONFORMING TO | ||
10 | BUGS | ||
11 | SEE ALSO | ||
12 | ---- | ||
13 | !!NAME | ||
14 | |||
15 | |||
16 | sysctl - read/write system parameters | ||
17 | !!SYNOPSIS | ||
18 | |||
19 | |||
20 | __#include __ | ||
21 | |||
22 | |||
23 | __#include __ | ||
24 | |||
25 | |||
26 | __#include __ | ||
27 | |||
28 | |||
2 | DashedDot | 29 | ___syscall1(int, _sysctl, struct __sysctl_args *, args);__ |
1 | perry | 30 | |
31 | |||
32 | __int _sysctl(struct __sysctl_args *__''args''__); | ||
33 | |||
34 | __!!DESCRIPTION | ||
35 | |||
36 | |||
37 | The ___sysctl__ call reads and/or writes kernel | ||
38 | parameters. For example, the hostname, or the maximum number | ||
39 | of open files. The argument has the form | ||
40 | |||
41 | |||
2 | DashedDot | 42 | struct __sysctl_args { |
43 | int *name; /* integer vector describing variable */ | ||
44 | int nlen; /* length of this vector */ | ||
45 | void *oldval; /* 0 or address where to store old value */ | ||
46 | size_t *oldlenp; /* available room for old value, overwritten by actual size of old value */ | ||
47 | void *newval; /* 0 or address of new value */ | ||
48 | size_t newlen; /* size of new value */ | ||
49 | }; | ||
50 | |||
51 | This call does a search in a tree structure, possibly resembling a directory tree under __/proc/sys__, | ||
52 | and if the requested item is found calls some appropriate routine to read or modify the value. | ||
53 | |||
1 | perry | 54 | !!EXAMPLE |
55 | |||
2 | DashedDot | 56 | #include |
1 | perry | 57 | |
58 | !!RETURN VALUE | ||
59 | |||
60 | Upon successful completion, ___sysctl__ returns 0. | ||
61 | Otherwise, a value of -1 is returned and ''errno'' is set | ||
62 | to indicate the error. | ||
2 | DashedDot | 63 | |
1 | perry | 64 | !!ERRORS |
65 | |||
66 | __ENOTDIR__ | ||
67 | |||
68 | ''name'' was not found. | ||
69 | |||
70 | __EPERM__ | ||
71 | |||
72 | No search permission for one of the encountered | ||
73 | `directories', or no read permission where ''oldval'' was | ||
74 | nonzero, or no write permission where ''newval'' was | ||
75 | nonzero. | ||
76 | |||
77 | __EFAULT__ | ||
78 | |||
79 | The invocation asked for the previous value by setting | ||
80 | ''oldval'' non-NULL, but allowed zero room in | ||
81 | ''oldlenp''. | ||
82 | !!CONFORMING TO | ||
83 | |||
84 | |||
85 | This call is Linux-specific, and should not be used in | ||
86 | programs intended to be portable. A __sysctl__ call has | ||
87 | been present in Linux since version 1.3.57. It originated in | ||
88 | 4.4BSD. Only Linux has the ''/proc/sys'' mirror, and the | ||
89 | object naming schemes differ between Linux and BSD 4.4, but | ||
90 | the declaration of the sysctl(2) function is the same | ||
91 | in both. | ||
92 | !!BUGS | ||
93 | |||
94 | |||
95 | The object names vary between kernel versions. THIS MAKES | ||
96 | THIS SYSTEM CALL WORTHLESS FOR APPLICATIONS. Use the | ||
97 | ''/proc/sys'' interface instead. | ||
98 | Not all available objects are properly documented. | ||
99 | It is not yet possible to change operating system by writing | ||
100 | to ''/proc/sys/kernel/ostype''. | ||
101 | !!SEE ALSO | ||
102 | |||
2 | DashedDot | 103 | [Sysctl | http://man-wiki.net/index.php/2:sysctl] |
1 | perry | 104 | |
105 | proc(5) | ||
106 | ---- |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 8 times)