3 .\" The DragonFly Project. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in
13 .\" the documentation and/or other materials provided with the
15 .\" 3. Neither the name of The DragonFly Project nor the names of its
16 .\" contributors may be used to endorse or promote products derived
17 .\" from this software without specific, prior written permission.
19 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .\".Nm cputime_pcpu_statistics ,
39 .Nm kinfo_get_maxfiles ,
40 .Nm kinfo_get_net_rtstatistics ,
41 .Nm kinfo_get_openfiles ,
42 .Nm kinfo_get_sched_cputime ,
43 .Nm kinfo_get_sched_hz ,
44 .Nm kinfo_get_sched_profhz ,
45 .Nm kinfo_get_sched_stathz ,
46 .Nm kinfo_get_tty_tk_nin ,
47 .Nm kinfo_get_tty_tk_nout ,
48 .Nm kinfo_get_vfs_bufspace
49 .\".Nm route_pcpu_statistics
50 .Nd information about the running kernel
56 .Fn kinfo_get_files "struct kinfo_file **file_buf" "size_t *len"
58 .Fn kinfo_get_maxfiles "int *maxfiles"
60 .Fn kinfo_get_openfiles "int *openfiles"
62 .Fn kinfo_get_net_rtstatistics "struct rtstatistics *rts"
64 .Fn kinfo_get_cpus "int *ncpus"
66 .Fn kinfo_get_sched_cputime "struct kinfo_cputime *cputime"
68 .Fn kinfo_get_sched_hz "int *hz"
70 .Fn kinfo_get_sched_profhz "int *profhz"
72 .Fn kinfo_get_sched_stathz "int *stathz"
74 .Fn kinfo_get_tty_tk_nin "uint64_t *tk_nin"
76 .Fn kinfo_get_tty_tk_nout "uint64_t *tk_nout"
78 .Fn kinfo_get_vfs_bufspace "long *bufspace"
80 .\".Fn cputime_pcpu_statistics "struct kinfo_cputime *percpu" "struct kinfo_cputime *total" "int ncpu"
82 .\".Fn route_pcpu_statistics "struct rtstatistics *percpu" "struct rtstatistics *total" "int ncpu"
87 function returns the kernel's file table as a pointer to an array of
92 The number of elements in the array is returned in
94 It is the caller's responsibility to
99 .Fn kinfo_get_maxfiles
101 .Fn kinfo_get_openfiles
102 functions return the maximum number of files and the number of open files in the
106 arguments, respectively.
107 .Ss Networking Information
109 .Fn kinfo_get_net_rtstatistics
110 function retrieves routing statistics from the kernel and fills out a
111 .Vt struct rtstatistics ,
112 a pointer to which has to be specified by the caller in
114 .Ss Scheduling/Time Information
117 function returns the number of active CPUs in the
122 .Fn kinfo_get_sched_cputime
123 function retrieves CPU time statistics from the kernel and fills out a
124 .Vt struct kinfo_cputime ,
125 a pointer to which has to be specified by the caller in
129 .Fn kinfo_get_sched_hz ,
130 .Fn kinfo_get_sched_profhz ,
132 .Fn kinfo_get_sched_stathz
133 functions retrieve system clock information from the kernel and return the
139 .Vt struct kinfo_clockinfo
145 arguments, respectively.
148 .Fn kinfo_get_tty_tk_nin
150 .Fn kinfo_get_tty_tk_nout
151 functions return the total number of characters which were input and output
152 on the system's TTYs in the
156 arguments, respectively.
159 .Fn kinfo_get_vfs_bufspace
160 function returns the maximum amount of memory available for VFS buffers in the
163 .\".Ss Per CPU Accumulators
164 .\".Fn cputime_pcpu_statistics
165 .\".Fn route_pcpu_statistics
171 .Fn kinfo_get_maxfiles ,
172 .Fn kinfo_get_openfiles ,
173 .Fn kinfo_get_sched_hz ,
174 .Fn kinfo_get_sched_profhz ,
175 .Fn kinfo_get_sched_stathz ,
176 .Fn kinfo_get_tty_tk_nin ,
177 .Fn kinfo_get_tty_tk_nout ,
179 .Fn kinfo_get_vfs_bufspace
180 functions can fail with the errors documented in
184 .Fn kinfo_get_files ,
185 .Fn kinfo_get_net_rtstatistics ,
187 .Fn kinfo_get_sched_cputime
188 functions will fail if:
191 Insufficient memory was available.
199 library first appeared in
202 .An "Joerg Sonnenberger"