FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include "opt_ddb.h"
#include "opt_ktrace.h"
#include "opt_sysctl.h"
#include <sys/param.h>
#include <sys/fail.h>
#include <sys/systm.h>
#include <sys/capsicum.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/sysctl.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/jail.h>
#include <sys/kdb.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/rmlock.h>
#include <sys/sbuf.h>
#include <sys/sx.h>
#include <sys/sysproto.h>
#include <sys/uio.h>
#include <net/vnet.h>
#include <security/mac/mac_framework.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
Go to the source code of this file.
Data Structures | |
struct | __sysctl_args |
struct | __sysctlbyname_args |
Macros | |
#define | SYSCTL_WLOCK() rm_wlock(&sysctllock) |
#define | SYSCTL_WUNLOCK() rm_wunlock(&sysctllock) |
#define | SYSCTL_RLOCK(tracker) rm_rlock(&sysctllock, (tracker)) |
#define | SYSCTL_RUNLOCK(tracker) rm_runlock(&sysctllock, (tracker)) |
#define | SYSCTL_WLOCKED() rm_wowned(&sysctllock) |
#define | SYSCTL_ASSERT_LOCKED() rm_assert(&sysctllock, RA_LOCKED) |
#define | SYSCTL_ASSERT_WLOCKED() rm_assert(&sysctllock, RA_WLOCKED) |
#define | SYSCTL_ASSERT_RLOCKED() rm_assert(&sysctllock, RA_RLOCKED) |
#define | SYSCTL_INIT() |
#define | SYSCTL_SLEEP(ch, wmesg, timo) rm_sleep(ch, &sysctllock, 0, wmesg, timo) |
Enumerations | |
enum | sysctl_iter_action { ITER_SIBLINGS , ITER_CHILDREN , ITER_FOUND } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_SYSCTL, "sysctl", "sysctl internal magic") |
static | MALLOC_DEFINE (M_SYSCTLOID, "sysctloid", "sysctl dynamic oids") |
static | MALLOC_DEFINE (M_SYSCTLTMP, "sysctltmp", "sysctl temp output buffer") |
static int | sysctl_root (SYSCTL_HANDLER_ARGS) |
static char * | sysctl_escape_name (const char *) |
static int | sysctl_remove_oid_locked (struct sysctl_oid *oidp, int del, int recurse) |
static int | sysctl_old_kernel (struct sysctl_req *, const void *, size_t) |
static int | sysctl_new_kernel (struct sysctl_req *, void *, size_t) |
static struct sysctl_oid * | sysctl_find_oidname (const char *name, struct sysctl_oid_list *list) |
void | sysctl_wlock (void) |
void | sysctl_wunlock (void) |
static int | sysctl_root_handler_locked (struct sysctl_oid *oid, void *arg1, intmax_t arg2, struct sysctl_req *req, struct rm_priotracker *tracker) |
static void | sysctl_load_tunable_by_oid_locked (struct sysctl_oid *oidp) |
static int | sysctl_search_oid (struct sysctl_oid **nodes, struct sysctl_oid *needle) |
static void | sysctl_warn_reuse (const char *func, struct sysctl_oid *leaf) |
void | sysctl_register_oid (struct sysctl_oid *oidp) |
void | sysctl_register_disabled_oid (struct sysctl_oid *oidp) |
void | sysctl_enable_oid (struct sysctl_oid *oidp) |
void | sysctl_unregister_oid (struct sysctl_oid *oidp) |
int | sysctl_ctx_init (struct sysctl_ctx_list *c) |
int | sysctl_ctx_free (struct sysctl_ctx_list *clist) |
struct sysctl_ctx_entry * | sysctl_ctx_entry_add (struct sysctl_ctx_list *clist, struct sysctl_oid *oidp) |
struct sysctl_ctx_entry * | sysctl_ctx_entry_find (struct sysctl_ctx_list *clist, struct sysctl_oid *oidp) |
int | sysctl_ctx_entry_del (struct sysctl_ctx_list *clist, struct sysctl_oid *oidp) |
int | sysctl_remove_oid (struct sysctl_oid *oidp, int del, int recurse) |
int | sysctl_remove_name (struct sysctl_oid *parent, const char *name, int del, int recurse) |
struct sysctl_oid * | sysctl_add_oid (struct sysctl_ctx_list *clist, struct sysctl_oid_list *parent, int number, const char *name, int kind, void *arg1, intmax_t arg2, int(*handler)(SYSCTL_HANDLER_ARGS), const char *fmt, const char *descr, const char *label) |
void | sysctl_rename_oid (struct sysctl_oid *oidp, const char *name) |
int | sysctl_move_oid (struct sysctl_oid *oid, struct sysctl_oid_list *parent) |
SET_DECLARE (sysctl_set, struct sysctl_oid) | |
static void | sysctl_register_all (void *arg) |
SYSINIT (sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, NULL) | |
static int | sysctl_sysctl_name (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_NAME, name, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_name, "") |
static enum sysctl_iter_action | sysctl_sysctl_next_node (struct sysctl_oid *oidp, int *name, unsigned int namelen, bool honor_skip) |
static bool | sysctl_sysctl_next_action (struct sysctl_oid_list *lsp, int *name, u_int namelen, int *next, int *len, int level, bool honor_skip) |
static int | sysctl_sysctl_next (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_NEXT, next, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_next, "") |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_NEXTNOSKIP, nextnoskip, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_next, "") |
static int | name2oid (char *name, int *oid, int *len, struct sysctl_oid **oidpp) |
static int | sysctl_sysctl_name2oid (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_sysctl, CTL_SYSCTL_NAME2OID, name2oid, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE|CTLFLAG_CAPRW, 0, 0, sysctl_sysctl_name2oid, "I", "") | |
static int | sysctl_sysctl_oidfmt (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_OIDFMT, oidfmt, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_oidfmt, "") |
static int | sysctl_sysctl_oiddescr (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_OIDDESCR, oiddescr, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_oiddescr, "") |
static int | sysctl_sysctl_oidlabel (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_sysctl, CTL_SYSCTL_OIDLABEL, oidlabel, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_oidlabel, "") |
int | sysctl_handle_bool (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_8 (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_16 (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_32 (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_int (SYSCTL_HANDLER_ARGS) |
int | sysctl_msec_to_ticks (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_long (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_64 (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_string (SYSCTL_HANDLER_ARGS) |
int | sysctl_handle_opaque (SYSCTL_HANDLER_ARGS) |
int | sysctl_usec_to_sbintime (SYSCTL_HANDLER_ARGS) |
int | sysctl_msec_to_sbintime (SYSCTL_HANDLER_ARGS) |
int | sysctl_sec_to_timeval (SYSCTL_HANDLER_ARGS) |
int | kernel_sysctl (struct thread *td, int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, int flags) |
int | kernel_sysctlbyname (struct thread *td, char *name, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, int flags) |
static int | sysctl_old_user (struct sysctl_req *req, const void *p, size_t l) |
static int | sysctl_new_user (struct sysctl_req *req, void *p, size_t l) |
int | sysctl_wire_old_buffer (struct sysctl_req *req, size_t len) |
int | sysctl_find_oid (int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req) |
int | sys___sysctl (struct thread *td, struct __sysctl_args *uap) |
int | kern___sysctlbyname (struct thread *td, const char *oname, size_t namelen, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, int flags, bool inkernel) |
int | sys___sysctlbyname (struct thread *td, struct __sysctlbyname_args *uap) |
int | userland_sysctl (struct thread *td, int *name, u_int namelen, void *old, size_t *oldlenp, int inkernel, const void *new, size_t newlen, size_t *retval, int flags) |
static int | sbuf_sysctl_drain (void *arg, const char *data, int len) |
struct sbuf * | sbuf_new_for_sysctl (struct sbuf *s, char *buf, int length, struct sysctl_req *req) |
Variables | |
static struct rmlock | sysctllock |
static struct sx __exclusive_cache_line | sysctlmemlock |
static struct sx | sysctlstringlock |
struct sysctl_oid_list | sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children) |
#define SYSCTL_ASSERT_LOCKED | ( | ) | rm_assert(&sysctllock, RA_LOCKED) |
Definition at line 112 of file kern_sysctl.c.
#define SYSCTL_ASSERT_RLOCKED | ( | ) | rm_assert(&sysctllock, RA_RLOCKED) |
Definition at line 114 of file kern_sysctl.c.
#define SYSCTL_ASSERT_WLOCKED | ( | ) | rm_assert(&sysctllock, RA_WLOCKED) |
Definition at line 113 of file kern_sysctl.c.
#define SYSCTL_INIT | ( | ) |
Definition at line 115 of file kern_sysctl.c.
#define SYSCTL_RLOCK | ( | tracker | ) | rm_rlock(&sysctllock, (tracker)) |
Definition at line 109 of file kern_sysctl.c.
#define SYSCTL_RUNLOCK | ( | tracker | ) | rm_runlock(&sysctllock, (tracker)) |
Definition at line 110 of file kern_sysctl.c.
#define SYSCTL_SLEEP | ( | ch, | |
wmesg, | |||
timo | |||
) | rm_sleep(ch, &sysctllock, 0, wmesg, timo) |
Definition at line 117 of file kern_sysctl.c.
#define SYSCTL_WLOCK | ( | ) | rm_wlock(&sysctllock) |
Definition at line 107 of file kern_sysctl.c.
#define SYSCTL_WLOCKED | ( | ) | rm_wowned(&sysctllock) |
Definition at line 111 of file kern_sysctl.c.
#define SYSCTL_WUNLOCK | ( | ) | rm_wunlock(&sysctllock) |
Definition at line 108 of file kern_sysctl.c.
enum sysctl_iter_action |
Enumerator | |
---|---|
ITER_SIBLINGS | |
ITER_CHILDREN | |
ITER_FOUND |
Definition at line 1147 of file kern_sysctl.c.
__FBSDID | ( | "$FreeBSD$" | ) |
int kern___sysctlbyname | ( | struct thread * | td, |
const char * | oname, | ||
size_t | namelen, | ||
void * | old, | ||
size_t * | oldlenp, | ||
void * | new, | ||
size_t | newlen, | ||
size_t * | retval, | ||
int | flags, | ||
bool | inkernel | ||
) |
Definition at line 2349 of file kern_sysctl.c.
References flags, free(), kernel_sysctl(), malloc(), name, and userland_sysctl().
Referenced by sys___sysctlbyname().
int kernel_sysctl | ( | struct thread * | td, |
int * | name, | ||
u_int | namelen, | ||
void * | old, | ||
size_t * | oldlenp, | ||
void * | new, | ||
size_t | newlen, | ||
size_t * | retval, | ||
int | flags | ||
) |
Definition at line 2006 of file kern_sysctl.c.
References flags, name, sysctl_new_kernel(), sysctl_old_kernel(), and sysctl_root().
Referenced by kern___sysctlbyname(), and kernel_sysctlbyname().
int kernel_sysctlbyname | ( | struct thread * | td, |
char * | name, | ||
void * | old, | ||
size_t * | oldlenp, | ||
void * | new, | ||
size_t | newlen, | ||
size_t * | retval, | ||
int | flags | ||
) |
Definition at line 2053 of file kern_sysctl.c.
References flags, kernel_sysctl(), and name.
|
static |
|
static |
|
static |
|
static |
Definition at line 1324 of file kern_sysctl.c.
References name, sysctl__children, and SYSCTL_ASSERT_LOCKED.
Referenced by sysctl_sysctl_name2oid().
struct sbuf * sbuf_new_for_sysctl | ( | struct sbuf * | s, |
char * | buf, | ||
int | length, | ||
struct sysctl_req * | req | ||
) |
Definition at line 2503 of file kern_sysctl.c.
References buf, sbuf_new(), sbuf_set_drain(), and sbuf_sysctl_drain().
Referenced by device_sysctl_handler(), dumpdevname_sysctl_handler(), kdb_sysctl_available(), sysctl_debug_tslog(), sysctl_debug_tslog_user(), sysctl_debug_witness_fullgraph(), sysctl_kern_malloc_stats(), sysctl_kern_proc_args(), sysctl_kern_proc_auxv(), sysctl_kern_proc_cwd(), sysctl_kern_proc_env(), sysctl_kern_proc_filedesc(), sysctl_kern_proc_vmmap(), sysctl_kern_timecounter_choice(), sysctl_out_proc(), sysctl_posix_shm_list(), and sysctl_preload_dump().
|
static |
Definition at line 2492 of file kern_sysctl.c.
References data.
Referenced by sbuf_new_for_sysctl().
SET_DECLARE | ( | sysctl_set | , |
struct sysctl_oid | |||
) |
int sys___sysctl | ( | struct thread * | td, |
struct __sysctl_args * | uap | ||
) |
Definition at line 2323 of file kern_sysctl.c.
References name, __sysctl_args::name, __sysctl_args::namelen, __sysctl_args::new, __sysctl_args::newlen, __sysctl_args::old, __sysctl_args::oldlenp, and userland_sysctl().
int sys___sysctlbyname | ( | struct thread * | td, |
struct __sysctlbyname_args * | uap | ||
) |
Definition at line 2395 of file kern_sysctl.c.
References kern___sysctlbyname(), __sysctlbyname_args::name, __sysctlbyname_args::namelen, __sysctlbyname_args::new, __sysctlbyname_args::newlen, __sysctlbyname_args::old, and __sysctlbyname_args::oldlenp.
struct sysctl_oid * sysctl_add_oid | ( | struct sysctl_ctx_list * | clist, |
struct sysctl_oid_list * | parent, | ||
int | number, | ||
const char * | name, | ||
int | kind, | ||
void * | arg1, | ||
intmax_t | arg2, | ||
int(*)(SYSCTL_HANDLER_ARGS) | handler, | ||
const char * | fmt, | ||
const char * | descr, | ||
const char * | label | ||
) |
Definition at line 866 of file kern_sysctl.c.
References free(), malloc(), name, parent, sysctl_ctx_entry_add(), sysctl_escape_name(), sysctl_find_oidname(), sysctl_register_oid(), sysctl_warn_reuse(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
struct sysctl_ctx_entry * sysctl_ctx_entry_add | ( | struct sysctl_ctx_list * | clist, |
struct sysctl_oid * | oidp | ||
) |
Definition at line 660 of file kern_sysctl.c.
References malloc(), and SYSCTL_ASSERT_WLOCKED.
Referenced by sysctl_add_oid().
int sysctl_ctx_entry_del | ( | struct sysctl_ctx_list * | clist, |
struct sysctl_oid * | oidp | ||
) |
Definition at line 695 of file kern_sysctl.c.
References free(), sysctl_ctx_entry_find(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
struct sysctl_ctx_entry * sysctl_ctx_entry_find | ( | struct sysctl_ctx_list * | clist, |
struct sysctl_oid * | oidp | ||
) |
Definition at line 675 of file kern_sysctl.c.
References SYSCTL_ASSERT_WLOCKED.
Referenced by sysctl_ctx_entry_del().
int sysctl_ctx_free | ( | struct sysctl_ctx_list * | clist | ) |
Definition at line 608 of file kern_sysctl.c.
References free(), panic(), sysctl_register_oid(), sysctl_remove_oid_locked(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
Referenced by alloc_bounce_zone(), cpufreq_detach(), and device_sysctl_fini().
int sysctl_ctx_init | ( | struct sysctl_ctx_list * | c | ) |
Definition at line 590 of file kern_sysctl.c.
Referenced by alloc_bounce_zone(), cpufreq_attach(), devclass_sysctl_init(), and device_sysctl_init().
void sysctl_enable_oid | ( | struct sysctl_oid * | oidp | ) |
Definition at line 542 of file kern_sysctl.c.
References SYSCTL_ASSERT_WLOCKED.
Referenced by linker_file_enable_sysctls().
|
static |
Definition at line 758 of file kern_sysctl.c.
References malloc().
Referenced by sysctl_add_oid().
int sysctl_find_oid | ( | int * | name, |
u_int | namelen, | ||
struct sysctl_oid ** | noid, | ||
int * | nindx, | ||
struct sysctl_req * | req | ||
) |
Definition at line 2160 of file kern_sysctl.c.
References name, sysctl__children, and SYSCTL_ASSERT_LOCKED.
Referenced by sysctl_root(), sysctl_sysctl_oiddescr(), sysctl_sysctl_oidfmt(), and sysctl_sysctl_oidlabel().
|
static |
Definition at line 132 of file kern_sysctl.c.
References name, and SYSCTL_ASSERT_LOCKED.
Referenced by sysctl_add_oid(), sysctl_move_oid(), and sysctl_register_oid().
int sysctl_handle_16 | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1580 of file kern_sysctl.c.
int sysctl_handle_32 | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1612 of file kern_sysctl.c.
int sysctl_handle_64 | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1746 of file kern_sysctl.c.
Referenced by sysctl_debug_ktr_mask(), sysctl_kern_timecounter_freq(), sysctl_msec_to_sbintime(), and sysctl_usec_to_sbintime().
int sysctl_handle_8 | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1548 of file kern_sysctl.c.
int sysctl_handle_bool | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1513 of file kern_sysctl.c.
int sysctl_handle_int | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1644 of file kern_sysctl.c.
Referenced by cpufreq_curr_sysctl(), kdb_sysctl_enter(), kdb_sysctl_panic(), kdb_sysctl_stack_overflow(), kdb_sysctl_trap(), kdb_sysctl_trap_code(), p31b_sysctl_proc(), poll_burst_max_sysctl(), poll_each_burst_sysctl(), reg_frac_sysctl(), syscal_vfs_cache_fast_lookup(), sysctl_bufdomain_int(), sysctl_clock_do_io(), sysctl_compress_user_cores(), sysctl_debug_ktr_clear(), sysctl_debug_ktr_entries(), sysctl_debug_num_cores_check(), sysctl_debug_witness_watch(), sysctl_devctl_queue(), sysctl_fast_gettime(), sysctl_ftry_reclaim_vnode(), sysctl_jail_default_allow(), sysctl_jail_default_level(), sysctl_kern_callout_stat(), sysctl_kern_eventtimer_periodic(), sysctl_kern_msgbuf_clear(), sysctl_kern_pid_max(), sysctl_kern_quantum(), sysctl_kern_randompid(), sysctl_kern_securelvl(), sysctl_kern_suser_enabled(), sysctl_kern_timecounter_adjprecision(), sysctl_kern_timecounter_get(), sysctl_machdep_adjkerntz(), sysctl_maxsockets(), sysctl_mb_use_ext_pgs(), sysctl_msec_to_ticks(), sysctl_negminpct(), sysctl_nmbclusters(), sysctl_nmbjumbo16(), sysctl_nmbjumbo9(), sysctl_nmbjumbop(), sysctl_nmbufs(), sysctl_numdirtybuffers(), sysctl_resettodr_period(), sysctl_sec_to_timeval(), sysctl_somaxconn(), sysctl_unprivileged_proc_debug(), and user_frac_sysctl().
int sysctl_handle_long | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1700 of file kern_sysctl.c.
Referenced by sysctl_bufdomain_long(), sysctl_bufspace(), sysctl_handle_pipe_mindirect(), sysctl_handle_sb_max(), sysctl_hostid(), sysctl_hw_physmem(), sysctl_hw_realmem(), sysctl_hw_usermem(), sysctl_kmem_map_free(), sysctl_kmem_map_size(), sysctl_maxvnodes(), sysctl_runningspace(), and sysctl_wantfreevnodes().
int sysctl_handle_opaque | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1867 of file kern_sysctl.c.
Referenced by ntp_sysctl(), sysctl_intrcnt(), sysctl_intrnames(), sysctl_kern_clockrate(), and sysctl_kern_msgbuf().
int sysctl_handle_string | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1778 of file kern_sysctl.c.
References free(), kdb_active, malloc(), sysctl_new_kernel(), and sysctlstringlock.
Referenced by _boottrace_sysctl(), cpufreq_levels_sysctl(), cpufreq_settings_sysctl(), kdb_sysctl_current(), kdb_sysctl_panic_str(), stats_tpl_list_available(), sysctl_debug_ktr_cpumask(), sysctl_debug_witness_channel(), sysctl_handle_domainset(), sysctl_hostname(), sysctl_jail_param(), sysctl_kern_console(), sysctl_kern_corefile(), sysctl_kern_eventtimer_timer(), sysctl_kern_proc_sv_name(), and sysctl_kern_timecounter_hardware().
|
static |
Definition at line 207 of file kern_sysctl.c.
References __aligned, data, freeenv(), getenv_array(), kern_getenv(), path, printf(), sysctl_new_kernel(), sysctl_old_kernel(), and sysctl_root_handler_locked().
Referenced by sysctl_register_oid().
int sysctl_move_oid | ( | struct sysctl_oid * | oid, |
struct sysctl_oid_list * | parent | ||
) |
Definition at line 941 of file kern_sysctl.c.
References parent, sysctl_find_oidname(), sysctl_register_oid(), sysctl_unregister_oid(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
int sysctl_msec_to_sbintime | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1925 of file kern_sysctl.c.
References sysctl_handle_64().
int sysctl_msec_to_ticks | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1673 of file kern_sysctl.c.
References hz, and sysctl_handle_int().
|
static |
Definition at line 1994 of file kern_sysctl.c.
Referenced by kernel_sysctl(), sysctl_handle_string(), and sysctl_load_tunable_by_oid_locked().
|
static |
Definition at line 2116 of file kern_sysctl.c.
Referenced by userland_sysctl().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 1973 of file kern_sysctl.c.
Referenced by kernel_sysctl(), and sysctl_load_tunable_by_oid_locked().
|
static |
Definition at line 2078 of file kern_sysctl.c.
References copyout_nofault().
Referenced by sysctl_wire_old_buffer(), and userland_sysctl().
SYSCTL_PROC | ( | _sysctl | , |
CTL_SYSCTL_NAME2OID | , | ||
name2oid | , | ||
CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY|CTLFLAG_MPSAFE| | CTLFLAG_CAPRW, | ||
0 | , | ||
0 | , | ||
sysctl_sysctl_name2oid | , | ||
"I" | , | ||
"" | |||
) |
|
static |
Definition at line 969 of file kern_sysctl.c.
References SYSCTL_INIT, sysctl_register_oid(), SYSCTL_WLOCK, SYSCTL_WUNLOCK, sysctlmemlock, and sysctlstringlock.
void sysctl_register_disabled_oid | ( | struct sysctl_oid * | oidp | ) |
Definition at line 526 of file kern_sysctl.c.
References sysctl_register_oid().
Referenced by linker_file_register_sysctls().
void sysctl_register_oid | ( | struct sysctl_oid * | oidp | ) |
Definition at line 425 of file kern_sysctl.c.
References panic(), parent, printf(), SYSCTL_ASSERT_WLOCKED, sysctl_find_oidname(), sysctl_load_tunable_by_oid_locked(), and sysctl_warn_reuse().
Referenced by linker_file_register_sysctls(), sysctl_add_oid(), sysctl_ctx_free(), sysctl_move_oid(), sysctl_register_all(), sysctl_register_disabled_oid(), and vfs_register().
int sysctl_remove_name | ( | struct sysctl_oid * | parent, |
const char * | name, | ||
int | del, | ||
int | recurse | ||
) |
Definition at line 732 of file kern_sysctl.c.
References name, parent, sysctl_remove_oid_locked(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
int sysctl_remove_oid | ( | struct sysctl_oid * | oidp, |
int | del, | ||
int | recurse | ||
) |
Definition at line 721 of file kern_sysctl.c.
References sysctl_remove_oid_locked(), SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
Referenced by et_deregister().
|
static |
Definition at line 792 of file kern_sysctl.c.
References free(), printf(), SYSCTL_ASSERT_WLOCKED, sysctl_remove_oid_locked(), SYSCTL_SLEEP, and sysctl_unregister_oid().
Referenced by sysctl_ctx_free(), sysctl_remove_name(), sysctl_remove_oid(), and sysctl_remove_oid_locked().
void sysctl_rename_oid | ( | struct sysctl_oid * | oidp, |
const char * | name | ||
) |
Definition at line 924 of file kern_sysctl.c.
References free(), name, SYSCTL_WLOCK, and SYSCTL_WUNLOCK.
Referenced by device_sysctl_update().
|
static |
Definition at line 2211 of file kern_sysctl.c.
References priv_check(), securelevel_gt(), sysctl_find_oid(), SYSCTL_RLOCK, sysctl_root_handler_locked(), and SYSCTL_RUNLOCK.
Referenced by kernel_sysctl(), and userland_sysctl().
|
static |
Definition at line 165 of file kern_sysctl.c.
References Giant, SYSCTL_RLOCK, SYSCTL_RUNLOCK, SYSCTL_WLOCK, SYSCTL_WUNLOCK, and wakeup().
Referenced by sysctl_load_tunable_by_oid_locked(), and sysctl_root().
|
static |
Definition at line 351 of file kern_sysctl.c.
References sysctl__children, and SYSCTL_ASSERT_LOCKED.
Referenced by sysctl_warn_reuse().
int sysctl_sec_to_timeval | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1949 of file kern_sysctl.c.
References sysctl_handle_int().
|
static |
Definition at line 1079 of file kern_sysctl.c.
References buf, name, snprintf(), sysctl__children, SYSCTL_RLOCK, SYSCTL_RUNLOCK, and sysctl_wire_old_buffer().
|
static |
Definition at line 1363 of file kern_sysctl.c.
References buf, free(), malloc(), name2oid(), SYSCTL_RLOCK, and SYSCTL_RUNLOCK.
|
static |
Definition at line 1292 of file kern_sysctl.c.
References name, sysctl__children, SYSCTL_RLOCK, SYSCTL_RUNLOCK, and sysctl_sysctl_next_action().
|
static |
Definition at line 1239 of file kern_sysctl.c.
References ITER_CHILDREN, ITER_FOUND, ITER_SIBLINGS, level, name, SYSCTL_ASSERT_LOCKED, sysctl_sysctl_next_action(), and sysctl_sysctl_next_node().
Referenced by sysctl_sysctl_next(), and sysctl_sysctl_next_action().
|
static |
Definition at line 1159 of file kern_sysctl.c.
References ITER_CHILDREN, ITER_FOUND, ITER_SIBLINGS, and name.
Referenced by sysctl_sysctl_next_action().
|
static |
Definition at line 1444 of file kern_sysctl.c.
References sysctl_find_oid(), SYSCTL_RLOCK, SYSCTL_RUNLOCK, and sysctl_wire_old_buffer().
|
static |
Definition at line 1412 of file kern_sysctl.c.
References sysctl_find_oid(), SYSCTL_RLOCK, SYSCTL_RUNLOCK, and sysctl_wire_old_buffer().
|
static |
Definition at line 1473 of file kern_sysctl.c.
References sysctl_find_oid(), SYSCTL_RLOCK, SYSCTL_RUNLOCK, and sysctl_wire_old_buffer().
void sysctl_unregister_oid | ( | struct sysctl_oid * | oidp | ) |
Definition at line 557 of file kern_sysctl.c.
References printf(), and SYSCTL_ASSERT_WLOCKED.
Referenced by linker_file_unregister_sysctls(), sysctl_move_oid(), sysctl_remove_oid_locked(), and vfs_register().
int sysctl_usec_to_sbintime | ( | SYSCTL_HANDLER_ARGS | ) |
Definition at line 1902 of file kern_sysctl.c.
References sysctl_handle_64().
|
static |
Definition at line 382 of file kern_sysctl.c.
References buf, sbuf_finish(), sbuf_new(), sbuf_printf(), sbuf_printf_drain(), sbuf_set_drain(), and sysctl_search_oid().
Referenced by sysctl_add_oid(), and sysctl_register_oid().
int sysctl_wire_old_buffer | ( | struct sysctl_req * | req, |
size_t | len | ||
) |
Definition at line 2136 of file kern_sysctl.c.
References sysctl_old_user().
Referenced by dumpdevname_sysctl_handler(), kdb_sysctl_enter(), kdb_sysctl_panic(), kdb_sysctl_stack_overflow(), kdb_sysctl_trap(), kdb_sysctl_trap_code(), sysctl_debug_witness_fullgraph(), sysctl_kern_file(), sysctl_kern_function_list(), sysctl_kern_malloc_stats(), sysctl_kern_proc(), sysctl_kern_randompid(), sysctl_kern_timecounter_choice(), sysctl_sysctl_name(), sysctl_sysctl_oiddescr(), sysctl_sysctl_oidfmt(), and sysctl_sysctl_oidlabel().
void sysctl_wlock | ( | void | ) |
Definition at line 151 of file kern_sysctl.c.
References SYSCTL_WLOCK.
Referenced by linker_file_enable_sysctls(), linker_file_register_sysctls(), linker_file_unregister_sysctls(), and vfs_register().
void sysctl_wunlock | ( | void | ) |
Definition at line 158 of file kern_sysctl.c.
References SYSCTL_WUNLOCK.
Referenced by linker_file_enable_sysctls(), linker_file_register_sysctls(), linker_file_unregister_sysctls(), and vfs_register().
SYSINIT | ( | sysctl | , |
SI_SUB_KMEM | , | ||
SI_ORDER_FIRST | , | ||
sysctl_register_all | , | ||
NULL | |||
) |
int userland_sysctl | ( | struct thread * | td, |
int * | name, | ||
u_int | namelen, | ||
void * | old, | ||
size_t * | oldlenp, | ||
int | inkernel, | ||
const void * | new, | ||
size_t | newlen, | ||
size_t * | retval, | ||
int | flags | ||
) |
Definition at line 2415 of file kern_sysctl.c.
References flags, kern_yield(), name, sysctl_new_user(), sysctl_old_user(), sysctl_root(), and sysctlmemlock.
Referenced by kern___sysctlbyname(), and sys___sysctl().
struct sysctl_oid_list sysctl__children = SLIST_HEAD_INITIALIZER(&sysctl__children) |
Definition at line 123 of file kern_sysctl.c.
Referenced by name2oid(), sysctl_find_oid(), sysctl_search_oid(), sysctl_sysctl_name(), and sysctl_sysctl_next().
|
static |
Definition at line 103 of file kern_sysctl.c.
|
static |
Definition at line 104 of file kern_sysctl.c.
Referenced by sysctl_register_all(), and userland_sysctl().
|
static |
Definition at line 105 of file kern_sysctl.c.
Referenced by sysctl_handle_string(), and sysctl_register_all().