]>
Commit | Line | Data |
---|---|---|
1f2f436a A |
1 | --- sysctl.3.orig 2010-04-28 23:38:49.000000000 -0700 |
2 | +++ sysctl.3 2010-04-29 10:13:28.000000000 -0700 | |
34e8f829 A |
3 | @@ -32,7 +32,7 @@ |
4 | .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 | |
5 | .\" $FreeBSD: src/lib/libc/gen/sysctl.3,v 1.63 2004/07/02 23:52:10 ru Exp $ | |
6 | .\" | |
7 | -.Dd January 23, 2001 | |
8 | +.Dd October 21, 2008 | |
9 | .Dt SYSCTL 3 | |
10 | .Os | |
11 | .Sh NAME | |
1f2f436a | 12 | @@ -182,13 +182,21 @@ for (i = 0; i < 100; i++) { |
59e0d9fe A |
13 | } |
14 | .Ed | |
15 | .Pp | |
3d9156a7 | 16 | +Note: Implementation of |
59e0d9fe A |
17 | +.Fn printkproc |
18 | +-- to print whatever data deemed necessary from the large | |
19 | +.Vt kinfo_proc | |
3d9156a7 | 20 | +structure ( |
1f2f436a | 21 | +.In sys/sysctl.h |
59e0d9fe A |
22 | +) -- is left as an exercise for the reader. |
23 | +.Pp | |
24 | The top level names are defined with a CTL_ prefix in | |
3d9156a7 | 25 | .In sys/sysctl.h , |
59e0d9fe A |
26 | and are as follows. |
27 | The next and subsequent levels down are found in the include files | |
28 | listed here, and described in separate sections below. | |
29 | .Pp | |
30 | -.Bl -column CTLXMACHDEPXXX "Next level namesXXXXXX" -offset indent | |
31 | +.Bl -column CTLXMACHDEP "Next level names" -offset indent | |
32 | .It Sy "Name Next level names Description" | |
3d9156a7 A |
33 | .It "CTL_DEBUG sys/sysctl.h Debugging" |
34 | .It "CTL_VFS sys/mount.h File system" | |
1f2f436a | 35 | @@ -197,7 +205,8 @@ listed here, and described in separate s |
3d9156a7 A |
36 | .It "CTL_MACHDEP sys/sysctl.h Machine dependent" |
37 | .It "CTL_NET sys/socket.h Networking" | |
38 | .It "CTL_USER sys/sysctl.h User-level" | |
39 | -.It "CTL_VM vm/vm_param.h Virtual memory" | |
40 | +.It "CTL_VM sys/resources.h Virtual memory (struct loadavg)" | |
41 | +.It "CTL_VM sys/vmmeter.h Virtual memory (struct vmtotal)" | |
59e0d9fe A |
42 | .El |
43 | .Pp | |
44 | For example, the following retrieves the maximum number of processes allowed | |
1f2f436a A |
45 | @@ -279,7 +288,7 @@ privilege may change the value. |
46 | .It Sy "Second level name Type Changeable" | |
47 | .It "HW_MACHINE string no" | |
48 | .It "HW_MODEL string no" | |
49 | -.It "HW_NCPU integer no" | |
50 | +.It "HW_NCPU integer no (DEPRECATED)" | |
51 | .It "HW_BYTEORDER integer no" | |
52 | .It "HW_PHYSMEM integer no" | |
53 | .It "HW_MEMSIZE integer no" | |
54 | @@ -296,8 +305,16 @@ privilege may change the value. | |
55 | The machine class. | |
56 | .It Li HW_MODEL | |
57 | The machine model | |
58 | -.It Li HW_NCPU | |
59 | -The number of cpus. | |
60 | +.It Li HW_NCPU (DEPRECATED) | |
61 | +The number of cpus. It is recommended that you use "hw.physicalcpu" "hw.physicalcpu_max" "hw.logicalcpu" or "hw.logicalcpu_max" instead. | |
62 | +.It Li "hw.physicalcpu" | |
63 | +The number of physical processors available in the current power management mode. | |
64 | +.It Li "hw.physicalcpu_max" | |
65 | +The maximum number of physical processors that could be available this boot. | |
66 | +.It Li "hw.logicalcpu" | |
67 | +The number of logical processors available in the current power management mode. | |
68 | +.It Li "hw.logicalcpu_max" | |
69 | +The maximum number of logical processors that could be available this boot. | |
70 | .It Li HW_BYTEORDER | |
71 | The byteorder (4,321, or 1,234). | |
72 | .It Li HW_PHYSMEM | |
73 | @@ -346,7 +363,7 @@ information. | |
74 | .It "KERN_OSREV integer no" | |
75 | .It "KERN_OSTYPE string no" | |
76 | .It "KERN_POSIX1 integer no" | |
77 | -.It "KERN_PROC struct proc no" | |
78 | +.It "KERN_PROC struct kinfo_proc no" | |
79 | .It "KERN_PROF node not applicable" | |
80 | .It "KERN_QUANTUM integer yes" | |
81 | .It "KERN_SAVED_IDS integer no" | |
82 | @@ -440,10 +457,8 @@ with which the system | |
83 | attempts to comply. | |
84 | .It Li KERN_PROC | |
85 | Return the entire process table, or a subset of it. | |
86 | -An array of pairs of | |
87 | -.Va struct proc | |
88 | -followed by corresponding | |
89 | -.Va struct eproc | |
90 | +An array of | |
91 | +.Va struct kinfo_proc | |
92 | structures is returned, | |
93 | whose size depends on the current number of such objects in the system. | |
94 | The third and fourth level names are as follows: | |
95 | @@ -456,16 +471,6 @@ The third and fourth level names are as | |
224c7076 A |
96 | .It "KERN_PROC_UID A user ID" |
97 | .It "KERN_PROC_RUID A real user ID" | |
98 | .El | |
99 | -.Pp | |
100 | -If the third level name is KERN_PROC_ARGS then the command line argument | |
101 | -array is returned in a flattened form, i.e., zero-terminated arguments | |
102 | -follow each other. | |
103 | -The total size of array is returned. | |
104 | -It is also possible for a process to set its own process title this way. | |
105 | -.Bl -column "Third level nameXXXXXX" "Fourth level is:XXXXXX" -offset indent | |
106 | -.It Sy "Third level name Fourth level is:" | |
107 | -.It "KERN_PROC_ARGS A process ID" | |
108 | -.El | |
109 | .It Li KERN_PROF | |
110 | Return profiling information about the kernel. | |
111 | If the kernel is not compiled for profiling, | |
1f2f436a | 112 | @@ -731,7 +736,6 @@ privilege may change the value. |
34e8f829 A |
113 | .Bl -column "Second level nameXXXXXX" "struct loadavgXXX" -offset indent |
114 | .It Sy "Second level name Type Changeable" | |
115 | .It "VM_LOADAVG struct loadavg no" | |
116 | -.It "VM_METER struct vmtotal no" | |
117 | .It "VM_PAGEOUT_ALGORITHM integer yes" | |
118 | .It "VM_SWAPPING_ENABLED integer maybe" | |
119 | .It "VM_V_CACHE_MAX integer yes" | |
1f2f436a | 120 | @@ -748,10 +752,6 @@ privilege may change the value. |
34e8f829 A |
121 | Return the load average history. |
122 | The returned data consists of a | |
123 | .Va struct loadavg . | |
124 | -.It Li VM_METER | |
125 | -Return the system wide virtual memory statistics. | |
126 | -The returned data consists of a | |
127 | -.Va struct vmtotal . | |
128 | .It Li VM_PAGEOUT_ALGORITHM | |
129 | 0 if the statistics-based page management algorithm is in use | |
130 | or 1 if the near-LRU algorithm is in use. | |
1f2f436a | 131 | @@ -848,7 +848,7 @@ identifiers, and user level identifiers |
224c7076 A |
132 | definitions for second level network identifiers |
133 | .It In sys/gmon.h | |
134 | definitions for third level profiling identifiers | |
135 | -.It In vm/vm_param.h | |
136 | +.It In mach/vm_param.h | |
137 | definitions for second level virtual memory identifiers | |
138 | .It In netinet/in.h | |
139 | definitions for third level IPv4/IPv6 identifiers and |