UbixOS V2 2.0

kern_sysctl.c
Go to the documentation of this file.
1 /*-
2 * Copyright (c) 2002-2018 The UbixOS Project.
3 * All rights reserved.
4 *
5 * This was developed by Christopher W. Olsen for the UbixOS Project.
6 *
7 * Redistribution and use in source and binary forms, with or without modification, are permitted
8 * provided that the following conditions are met:
9 *
10 * 1) Redistributions of source code must retain the above copyright notice, this list of
11 * conditions, the following disclaimer and the list of authors.
12 * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13 * conditions, the following disclaimer and the list of authors in the documentation and/or
14 * other materials provided with the distribution.
15 * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16 * endorse or promote products derived from this software without specific prior written
17 * permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #include <sys/kern_sysctl.h>
30 #include <sys/sysproto_posix.h>
31 #include <sys/thread.h>
32 #include <ubixos/endtask.h>
33 #include <ubixos/kpanic.h>
34 #include <lib/kprintf.h>
35 #include <lib/kmalloc.h>
36 #include <assert.h>
37 #include <string.h>
38 #include <ubixos/errno.h>
39 #include <lib/kern_trie.h>
40
41 static struct sysctl_entry *ctls = 0x0;
42
43 static struct sysctl_entry *sysctl_find(int *, int);
44 static struct sysctl_entry *sysctl_findMib(char *name, int namelen);
45
46 struct Trie *sysctl_headTrie = 0x0;
47
48 /* This is a cheat for now */
49 static void def_ctls() {
50 int name[CTL_MAXNAME], name_len;
51 uint32_t page_val = 0x1000;
52 int32_t usPage_val = 0x0;
53 name[0] = 6;
54 name[1] = 7;
55 name_len = 2;
56 sysctl_add(name, name_len, "pagesizes", &page_val, sizeof(uint32_t));
57
58 /* Clock Rate */
59 name[0] = 1;
60 name[1] = 12;
61 page_val = 0x3E8;
62 sysctl_add(name, name_len, "page_size", &page_val, sizeof(uInt32));
63
64 /* KERN: OS Release */
65 name[0] = 1;
66 name[1] = 24;
67 page_val = 101000;
68 sysctl_add(name, name_len, "kern.osreldate", &page_val, sizeof(uInt32));
69
70 /* KERN: User Stack */
71 name[0] = 1;
72 name[1] = 33;
73 page_val = 0xCBE8000;
74 sysctl_add(name, name_len, "page_size", &page_val, sizeof(uInt32));
75
76 /* KERN: ARND */
77 name[0] = 1;
78 name[1] = 37;
79 page_val = 0x1;
80 sysctl_add(name, name_len, "kern_arnd", &page_val, sizeof(uint32_t));
81
82 /* HW: NCPU */
83 name[0] = 6;
84 name[1] = 3;
85 page_val = 0x1;
86 sysctl_add(name, name_len, "hw.ncpu", &page_val, sizeof(uint32_t));
87
88 name[0] = 9;
89 name[1] = 20;
90 page_val = 0x4000;
91 sysctl_add(name, name_len, "p1003_1b.pagesize", &page_val, sizeof(uint32_t));
92
93 /* XXX 1, 1 */
94 name[0] = 1;
95 name[1] = 1;
96 char s11[4] = "UBIX";
97 sysctl_add(name, name_len, "kern.ostype", &s11, 4);
98
99 /* XXX 1, 10 */
100 name[0] = 1;
101 name[1] = 10;
102 char s110[16] = "devel.ubixos.com";
103 sysctl_add(name, name_len, "kern.hostname", &s110, 16);
104
105 /* XXX 1, 2 */
106 name[0] = 1;
107 name[1] = 2;
108 char s12[11] = "1.0-RELEASE";
109 sysctl_add(name, name_len, "kern.hostname", &s12, 11);
110
111 /* XXX 1, 4 */
112 name[0] = 1;
113 name[1] = 4;
114 char s14[18] = "UbixOS 1.0-RELEASE";
115 sysctl_add(name, name_len, "kern.hostname", &s14, 18);
116
117 /* XXX 6, 1 */
118 name[0] = 6;
119 name[1] = 1;
120 char s61[4] = "i386";
121 sysctl_add(name, name_len, "kern.hostname", &s61, 4);
122
123 /* XXX 6, 2147482988 */
124 name[0] = 6;
125 name[1] = 2147482988;
126 page_val = 4096;
127 sysctl_add(name, name_len, "hw.pagesizes", &page_val, sizeof(u_int32_t));
128
129 name[0] = 2;
130 name[1] = 12;
131 page_val = 0;
132 sysctl_add(name, name_len, "vm.overcommit", &page_val, sizeof(u_int32_t));
133
134 name[0] = 1;
135 name[1] = 18;
136 usPage_val = 1023;
137 sysctl_add(name, name_len, "kern.ngroups", &page_val, sizeof(int32_t));
138
139 /* XXX 6, 1 */
140 name[0] = 2;
141 name[1] = 134516822;
142 char s62[2] = "\0";
143 sysctl_add(name, name_len, "kern.msgbuf", &s62, 1);
144
145 }
146
147 int sysctl_init() {
148
149 struct sysctl_entry *tmpCtl = 0x0;
150
151 if (ctls != 0x0) {
152 kprintf("sysctl already Initialized\n");
153 while (1)
154 ;
155 }
156
157 /* Initialize Head Trie */
158 sysctl_headTrie = (struct Trie *) kmalloc(sizeof(struct Trie));
159
160 ctls = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
161 ctls->prev = 0x0;
162 ctls->id = CTL_UNSPEC;
163 ctls->children = 0x0;
164 sprintf(ctls->name, "unspec");
165
166 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
167
168 tmpCtl = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
169 tmpCtl->prev = ctls;
170 tmpCtl->id = CTL_KERN;
171 tmpCtl->children = 0x0;
172 sprintf(tmpCtl->name, "kern");
173 ctls->next = tmpCtl;
174 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
175
176 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
177 tmpCtl->next->prev = tmpCtl;
178 tmpCtl = tmpCtl->next;
179 tmpCtl->id = CTL_VM;
180 tmpCtl->children = 0x0;
181 sprintf(tmpCtl->name, "vm");
182 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
183
184 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
185 tmpCtl->next->prev = tmpCtl;
186 tmpCtl = tmpCtl->next;
187 tmpCtl->id = CTL_VFS;
188 tmpCtl->children = 0x0;
189 sprintf(tmpCtl->name, "vfs");
190 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
191
192 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
193 tmpCtl->next->prev = tmpCtl;
194 tmpCtl = tmpCtl->next;
195 tmpCtl->id = CTL_NET;
196 tmpCtl->children = 0x0;
197 sprintf(tmpCtl->name, "net");
198 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
199
200 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
201 tmpCtl->next->prev = tmpCtl;
202 tmpCtl = tmpCtl->next;
203 tmpCtl->id = CTL_DEBUG;
204 tmpCtl->children = 0x0;
205 sprintf(tmpCtl->name, "debug");
206 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
207
208 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
209 tmpCtl->next->prev = tmpCtl;
210 tmpCtl = tmpCtl->next;
211 tmpCtl->id = CTL_HW;
212 tmpCtl->children = 0x0;
213 sprintf(tmpCtl->name, "hw");
214 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
215
216 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
217 tmpCtl->next->prev = tmpCtl;
218 tmpCtl = tmpCtl->next;
219 tmpCtl->id = CTL_MACHDEP;
220 tmpCtl->children = 0x0;
221 sprintf(tmpCtl->name, "machdep");
222 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
223
224 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
225 tmpCtl->next->prev = tmpCtl;
226 tmpCtl = tmpCtl->next;
227 tmpCtl->id = CTL_USER;
228 tmpCtl->children = 0x0;
229 sprintf(tmpCtl->name, "user");
230 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
231
232 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
233 tmpCtl->next->prev = tmpCtl;
234 tmpCtl = tmpCtl->next;
235 tmpCtl->id = CTL_P1003_1B;
236 tmpCtl->children = 0x0;
237 sprintf(tmpCtl->name, "p1003_1b");
238
239 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
240
241 tmpCtl->next = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
242 tmpCtl->next->prev = tmpCtl;
243 tmpCtl = tmpCtl->next;
244 tmpCtl->id = CTL_UBIX;
245 tmpCtl->children = 0x0;
246 sprintf(tmpCtl->name, "ubix");
247
248 insert_trieNode(&sysctl_headTrie, ctls->name, ctls);
249
250 def_ctls();
251
252 return (0x0);
253 }
254
255 int __sysctl(struct thread *td, struct sysctl_args *uap) {
256 struct sysctl_entry *tmpCtl = 0x0;
257 int i = 0;
258
259 if (ctls == 0x0)
260 K_PANIC("sysctl not initialized");
261
262 if (uap->newlen < 0) {
263 kprintf("Changing Not supported yet.\n");
264 endTask(_current->id);
265 }
266
267 tmpCtl = sysctl_find(uap->name, uap->namelen);
268 if (tmpCtl == 0x0) {
269 kprintf("Invalid CTL\n");
270 for (i = 0x0; i < uap->namelen; i++)
271 kprintf("(%i)", uap->name[i]);
272 kprintf("\n");
273 endTask(_current->id);
274 }
275
276 if ((uint32_t) uap->oldlenp < tmpCtl->val_len)
277 memcpy(uap->oldp, tmpCtl->value, (uInt32) uap->oldlenp);
278 else
279 memcpy(uap->oldp, tmpCtl->value, tmpCtl->val_len);
280
281 td->td_retval[0] = 0x0;
282
283 return (0x0);
284 }
285
286 int sys_sysctl(struct thread *td, struct sys_sysctl_args *args) {
287 struct sysctl_entry *tmpCtl = 0x0;
288 struct Trie *tmpTrie = 0x0;
289 int i = 0;
290
291 if (ctls == 0x0)
292 K_PANIC("sysctl not initialized");
293
294 if (args->newlenp < 0) {
295 kprintf("Changing Not supported yet.\n");
296 endTask(_current->id);
297 }
298
299 /* XXX - Handle search by name */
300 if (args->namelen == 2 && args->name[0] == 0 && args->name[1] == 3) {
301
302 tmpTrie = search_trieNode(sysctl_headTrie, args->newp);
303
304 if (tmpTrie != 0x0) {
305 tmpCtl = (struct sysctl_entry *)tmpTrie->e;
306
307 //kprintf("<FT: %s:%i>\n", tmpCtl->name,tmpCtl->namelen);
308
309 // tmpCtl = sysctl_findMib(args->newp, args->namelen);
310 *args->oldlenp = tmpCtl->namelen *4;
311 u_int32_t *oldp = args->oldp;
312
313 for (i=0;i<tmpCtl->namelen;i++)
314 oldp[i] = tmpCtl->full_name[i];
315
316 td->td_retval[0] = 0; /* XXX - Very Bad need to store namelen in the struct */
317
318 return(0x0);
319 }
320 else {
321
322 #ifdef DEBUG_SYSCTL
323 kprintf("%s:%i>name_to_mib: %s\n", __FILE__,__LINE__,args->newp);
324 #endif
325
326 td->td_retval[0] = ENOENT;
327 return(-1);
328 }
329 }
330 else {
331 tmpCtl = sysctl_find(args->name, args->namelen);
332 }
333
334 if (tmpCtl == 0x0) {
335 kprintf("Invalid CTL(%i): ", args->namelen);
336 for (i = 0x0; i < args->namelen; i++)
337 kprintf("(%i)", (int) args->name[i]);
338 kprintf("\n");
339 td->td_retval[0] = -1;
340 return (-1);
341 }
342 /*
343 else {
344 kprintf("Valid CTL(%i): ", args->namelen);
345 for (i = 0x0; i < args->namelen; i++)
346 kprintf("(%i)", (int) args->name[i]);
347 kprintf("\n");
348 }
349
350 kprintf("{%i:%i}\n",args->oldlenp, tmpCtl->val_len);
351
352 */
353
354 if ((uint32_t) args->oldlenp < tmpCtl->val_len)
355 memcpy(args->oldp, tmpCtl->value, (uInt32) args->oldlenp);
356 else
357 memcpy(args->oldp, tmpCtl->value, tmpCtl->val_len);
358
359 td->td_retval[0] = 0x0;
360
361 return (0x0);
362 }
363
364 static struct sysctl_entry *sysctl_find(int *name, int namelen) {
365 int i = 0x0;
366 struct sysctl_entry *tmpCtl = 0x0;
367 struct sysctl_entry *lCtl = ctls;
368
369 /* Loop Name Len */
370 for (i = 0x0; i < namelen; i++) {
371 for (tmpCtl = lCtl; tmpCtl != 0x0; tmpCtl = tmpCtl->next) {
372 //kprintf("ctlName: [%s], ctlId; [%i]\n",tmpCtl->name,tmpCtl->id);
373 if (tmpCtl->id == name[i]) {
374 if ((i + 1) == namelen) {
375 return (tmpCtl);
376 }
377 lCtl = tmpCtl->children;
378 break;
379 }
380 }
381 }
382 return (0x0);
383 }
384
385
386 static struct sysctl_entry *sysctl_findMib(char *name, int namelen) {
387 int i = 0x0;
388 struct sysctl_entry *tmpCtl = 0x0;
389 struct sysctl_entry *lCtl = ctls;
390
391 char *mib = (char *) strtok( (char *) name, "." );
392
393
394 kprintf("FMIB: %s", mib);
395
396 lCtl = (struct sysctl_entry *) search_trieNode(sysctl_headTrie, mib)->e;
397 kprintf("FT: %s", lCtl->name);
398
399 /* Loop Name Len */
400 for (i = 0x0; i < namelen; i++) {
401 for (tmpCtl = lCtl; tmpCtl != 0x0; tmpCtl = tmpCtl->next) {
402 if (strcmp(mib, tmpCtl->name) == 0x0) {
403 kprintf("ctlName: [%s], ctlId: [%i]",tmpCtl->name,tmpCtl->id);
404 if ((i + 1) == namelen) {
405 return (tmpCtl);
406 }
407 mib = strtok( NULL, "\n" );
408 kprintf("SMIB: %s", mib);
409 lCtl = tmpCtl->children;
410 break;
411 }
412 }
413 }
414 return (0x0);
415 }
416
417
418 int sysctl_add(int *name, int namelen, char *str_name, void *buf, int buf_size) {
419 struct sysctl_entry *tmpCtl = 0x0;
420 struct sysctl_entry *newCtl = 0x0;
421 int i = 0;
422
423 /* Check if it exists */
424 tmpCtl = sysctl_find(name, namelen);
425 if (tmpCtl != 0x0) {
426 kprintf("Node Exists! [%s]\n", str_name);
427 while (1)
428 ;
429 }
430
431 /* Get Parent Node */
432 tmpCtl = sysctl_find(name, namelen - 1);
433 if (tmpCtl == 0x0) {
434 kprintf("Parent Node Non Existant\n");
435 return (-1);
436 }
437 if (tmpCtl->children == 0x0) {
438 tmpCtl->children = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
439 memset(tmpCtl->children, 0x0, sizeof(struct sysctl_entry));
440 tmpCtl->children->children = 0x0;
441 tmpCtl->children->prev = 0x0;
442 tmpCtl->children->next = 0x0;
443 tmpCtl->children->id = name[namelen - 1];
444 for (i = 0; i < namelen;i++)
445 tmpCtl->children->full_name[i] = name[i];
446
447 tmpCtl->children->namelen = namelen;
448
449 sprintf(tmpCtl->children->name, str_name);
450
451 insert_trieNode(&sysctl_headTrie, tmpCtl->children->name, tmpCtl->children);
452
453 tmpCtl->children->value = (void *) kmalloc(buf_size);
454 memcpy(tmpCtl->children->value, buf, buf_size);
455 tmpCtl->children->val_len = buf_size;
456 }
457 else {
458 newCtl = (struct sysctl_entry *) kmalloc(sizeof(struct sysctl_entry));
459 memset(newCtl, 0x0, sizeof(struct sysctl_entry));
460 newCtl->prev = 0x0;
461 newCtl->next = tmpCtl->children;
462 newCtl->children = 0x0;
463 newCtl->id = name[namelen - 1];
464
465 for (i = 0; i<namelen;i++)
466 newCtl->full_name[i] = name[i];
467
468 newCtl->namelen = namelen;
469
470 sprintf(newCtl->name, str_name);
471
472 insert_trieNode(&sysctl_headTrie, newCtl->name, newCtl);
473
474 newCtl->value = (void *) kmalloc(buf_size);
475 memcpy(newCtl->value, buf, buf_size);
476 newCtl->val_len = buf_size;
477 tmpCtl->children->prev = newCtl;
478 tmpCtl->children = newCtl;
479 }
480
481 return (0x0);
482 }
483
484 /***
485 END
486 ***/
strtok
char * strtok(char *str, const char *sep)
Definition: strtok.c:76
sysctl_args::oldp
void * oldp
Definition: sysproto_posix.h:318
sysctl_entry::value
void * value
Definition: kern_sysctl.h:62
kern_sysctl.h
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
__sysctl
int __sysctl(struct thread *td, struct sysctl_args *uap)
Definition: kern_sysctl.c:255
sysctl_entry::children
struct sysctl_entry * children
Definition: kern_sysctl.h:59
sys_sysctl_args::oldlenp
size_t * oldlenp
Definition: sysproto_posix.h:240
K_PANIC
#define K_PANIC(msg)
Definition: kpanic.h:32
string.h
sysctl_headTrie
struct Trie * sysctl_headTrie
Definition: kern_sysctl.c:46
sysproto_posix.h
sysctl_entry::full_name
int full_name[24]
Definition: kern_sysctl.h:64
sysctl_entry
Definition: kern_sysctl.h:56
thread
Definition: thread.h:40
strcmp
int strcmp(const char *str1, const char *str2)
assert.h
search_trieNode
struct Trie * search_trieNode(struct Trie *, char *)
Definition: kern_trie.c:70
endtask.h
CTL_MACHDEP
#define CTL_MACHDEP
Definition: kern_sysctl.h:47
CTL_USER
#define CTL_USER
Definition: kern_sysctl.h:48
CTL_UNSPEC
#define CTL_UNSPEC
Definition: kern_sysctl.h:40
CTL_NET
#define CTL_NET
Definition: kern_sysctl.h:44
CTL_UBIX
#define CTL_UBIX
Definition: kern_sysctl.h:50
memcpy
void * memcpy(const void *dst, const void *src, size_t length)
sprintf
int sprintf(char *buf, const char *fmt,...)
Definition: kprintf.c:278
sys_sysctl
int sys_sysctl(struct thread *td, struct sys_sysctl_args *args)
Definition: kern_sysctl.c:286
CTL_HW
#define CTL_HW
Definition: kern_sysctl.h:46
sys_sysctl_args::namelen
u_int namelen
Definition: sysproto_posix.h:234
kpanic.h
taskStruct::id
pidType id
Definition: sched.h:63
sys_sysctl_args::newp
void * newp
Definition: sysproto_posix.h:243
thread::td_retval
int td_retval[2]
Definition: thread.h:41
kprintf.h
sys_sysctl_args::newlenp
size_t newlenp
Definition: sysproto_posix.h:246
CTL_MAXNAME
#define CTL_MAXNAME
Definition: kern_sysctl.h:35
sysctl_args::oldlenp
size_t * oldlenp
Definition: sysproto_posix.h:321
Trie::e
void * e
Definition: kern_trie.h:39
CTL_KERN
#define CTL_KERN
Definition: kern_sysctl.h:41
sysctl_add
int sysctl_add(int *name, int namelen, char *str_name, void *buf, int buf_size)
Definition: kern_sysctl.c:418
sysctl_args
Definition: sysproto_posix.h:310
buf
Definition: buf.h:35
sysctl_entry::next
struct sysctl_entry * next
Definition: kern_sysctl.h:58
uint32_t
__uint32_t uint32_t
Definition: types.h:46
sysctl_args::newlen
size_t newlen
Definition: sysproto_posix.h:327
int32_t
__int32_t int32_t
Definition: types.h:108
sysctl_entry::prev
struct sysctl_entry * prev
Definition: kern_sysctl.h:57
insert_trieNode
void insert_trieNode(struct Trie **, char *, void *)
Definition: kern_trie.c:46
CTL_VFS
#define CTL_VFS
Definition: kern_sysctl.h:43
endTask
void endTask(pidType)
Definition: endtask.c:44
_current
kTask_t * _current
Definition: sched.c:50
kern_trie.h
sysctl_entry::name
char name[32]
Definition: kern_sysctl.h:60
sysctl_init
int sysctl_init()
Definition: kern_sysctl.c:147
sys_sysctl_args
Definition: sysproto_posix.h:229
name
const char * name
Definition: pci.c:37
CTL_P1003_1B
#define CTL_P1003_1B
Definition: kern_sysctl.h:49
sysctl_entry::namelen
int namelen
Definition: kern_sysctl.h:65
kmalloc
void * kmalloc(uInt32 len)
Definition: kmalloc.c:241
memset
void * memset(void *dst, int c, size_t length)
ENOENT
#define ENOENT
Definition: errno.h:33
Trie
Definition: kern_trie.h:36
sysctl_entry::val_len
int val_len
Definition: kern_sysctl.h:63
sysctl_args::name
int * name
Definition: sysproto_posix.h:312
sysctl_args::namelen
u_int namelen
Definition: sysproto_posix.h:315
sys_sysctl_args::oldp
void * oldp
Definition: sysproto_posix.h:237
sysctl_entry::id
int id
Definition: kern_sysctl.h:61
kprintf
int kprintf(const char *,...)
Definition: kprintf.c:259
errno.h
u_int32_t
__uint32_t u_int32_t
Definition: types.h:53
thread.h
kmalloc.h
sys_sysctl_args::name
int * name
Definition: sysproto_posix.h:231
CTL_DEBUG
#define CTL_DEBUG
Definition: kern_sysctl.h:45
CTL_VM
#define CTL_VM
Definition: kern_sysctl.h:42
NULL
#define NULL
Definition: fat_string.h:17