# kern_sysctl.c File Reference

`#include <ubixos/types.h>`
`#include <sys/sysproto.h>`
`#include <sys/thread.h>`
`#include <sys/kern_sysctl.h>`
`#include <ubixos/endtask.h>`
`#include <ubixos/kpanic.h>`
`#include <lib/kprintf.h>`
`#include <lib/kmalloc.h>`
`#include <assert.h>`
`#include <string.h>`

Include dependency graph for kern_sysctl.c:

Go to the source code of this file.

## Functions

int | __sysctl (struct thread *td, struct sysctl_args *uap)
static void | def_ctls ()
int | sysctl_add (int *name, int namelen, char *str_name, void *buf, int buf_size)
static struct sysctl_entry * | sysctl_find (int *, int)
int | sysctl_init ()

## Variables

static struct sysctl_entry * | ctls = 0x0

## Function Documentation

int __sysctl | ( | struct thread * | td,
|  | struct sysctl_args * | uap |
| ) |  |  |

Definition at line 153 of file kern_sysctl.c.

References _current, ctls, endTask(), taskStruct::id, K_PANIC, kprintf(), memcpy(), sysctl_args::name, sysctl_args::namelen, sysctl_args::newlen, sysctl_args::old, sysctl_args::oldlenp, sysctl_find(), thread::td_retval, sysctl_entry::val_len, and sysctl_entry::value.

Here is the call graph for this function:

static void def_ctls | ( |  | ) | `[static]`

Definition at line 46 of file kern_sysctl.c.

References CTL_MAXNAME, name, and sysctl_add().

Referenced by sysctl_init().

Here is the call graph for this function:

int sysctl_add | ( | int * | name,
|  | int | namelen,
|  | char * | str_name,
|  | void * | buf,
|  | int | buf_size |
| ) |  |  |

Definition at line 205 of file kern_sysctl.c.

References sysctl_entry::children, sysctl_entry::id, kmalloc(), kprintf(), memcpy(), sysctl_entry::name, sysctl_entry::next, sysctl_entry::prev, sprintf(), sysctl_find(), sysctl_entry::val_len, and sysctl_entry::value.

Referenced by def_ctls().

Here is the call graph for this function:

static struct sysctl_entry * sysctl_find | ( | int * | ,
|  | int |  |
| ) |  |  | `[static]`

Definition at line 184 of file kern_sysctl.c.

References sysctl_entry::children, ctls, sysctl_entry::id, and sysctl_entry::next.

Referenced by __sysctl(), and sysctl_add().

int sysctl_init | ( |  | ) |

Definition at line 65 of file kern_sysctl.c.

References sysctl_entry::children, CTL_DEBUG, CTL_HW, CTL_KERN, CTL_MACHDEP, CTL_NET, CTL_P1003_1B, CTL_UBIX, CTL_UNSPEC, CTL_USER, CTL_VFS, CTL_VM, ctls, def_ctls(), sysctl_entry::id, kmalloc(), kprintf(), sysctl_entry::name, sysctl_entry::next, sysctl_entry::prev, and sprintf().

Here is the call graph for this function:

## Variable Documentation

struct sysctl_entry* ctls = 0x0`[static]`

Definition at line 41 of file kern_sysctl.c.

Referenced by __sysctl(), sysctl_find(), and sysctl_init().