Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/sysctl.h
Show All 36 Lines | |||||
#ifndef _SYS_SYSCTL_H_ | #ifndef _SYS_SYSCTL_H_ | ||||
#define _SYS_SYSCTL_H_ | #define _SYS_SYSCTL_H_ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#endif | #endif | ||||
struct thread; | |||||
/* | /* | ||||
* Definitions for sysctl call. The sysctl call uses a hierarchical name | * Definitions for sysctl call. The sysctl call uses a hierarchical name | ||||
* for objects that can be examined or modified. The name is expressed as | * for objects that can be examined or modified. The name is expressed as | ||||
* a sequence of integers. Like a file path name, the meaning of each | * a sequence of integers. Like a file path name, the meaning of each | ||||
* component depends on its place in the hierarchy. The top-level and kern | * component depends on its place in the hierarchy. The top-level and kern | ||||
* identifiers are defined here, and other identifiers are defined in the | * identifiers are defined here, and other identifiers are defined in the | ||||
* respective subsystem header files. | * respective subsystem header files. | ||||
* | |||||
* Each subsystem defined by sysctl defines a list of variables for that | |||||
* subsystem. Each name is either a node with further levels defined below it, | |||||
* or it is a leaf of some particular type given below. Each sysctl level | |||||
* defines a set of name/type pairs to be used by sysctl(8) in manipulating the | |||||
* subsystem. | |||||
*/ | */ | ||||
#define CTL_MAXNAME 24 /* largest number of components supported */ | #define CTL_MAXNAME 24 /* largest number of components supported */ | ||||
/* | |||||
* Each subsystem defined by sysctl defines a list of variables | |||||
* for that subsystem. Each name is either a node with further | |||||
* levels defined below it, or it is a leaf of some particular | |||||
* type given below. Each sysctl level defines a set of name/type | |||||
* pairs to be used by sysctl(8) in manipulating the subsystem. | |||||
*/ | |||||
struct ctlname { | |||||
char *ctl_name; /* subsystem name */ | |||||
int ctl_type; /* type of name */ | |||||
}; | |||||
#define CTLTYPE 0xf /* mask for the type */ | #define CTLTYPE 0xf /* mask for the type */ | ||||
#define CTLTYPE_NODE 1 /* name is a node */ | #define CTLTYPE_NODE 1 /* name is a node */ | ||||
#define CTLTYPE_INT 2 /* name describes an integer */ | #define CTLTYPE_INT 2 /* name describes an integer */ | ||||
#define CTLTYPE_STRING 3 /* name describes a string */ | #define CTLTYPE_STRING 3 /* name describes a string */ | ||||
#define CTLTYPE_S64 4 /* name describes a signed 64-bit number */ | #define CTLTYPE_S64 4 /* name describes a signed 64-bit number */ | ||||
#define CTLTYPE_OPAQUE 5 /* name describes a structure */ | #define CTLTYPE_OPAQUE 5 /* name describes a structure */ | ||||
#define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ | #define CTLTYPE_STRUCT CTLTYPE_OPAQUE /* name describes a structure */ | ||||
#define CTLTYPE_UINT 6 /* name describes an unsigned integer */ | #define CTLTYPE_UINT 6 /* name describes an unsigned integer */ | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
#ifdef COMPAT_FREEBSD32 | #ifdef COMPAT_FREEBSD32 | ||||
#define SCTL_MASK32 1 /* 32 bit emulation */ | #define SCTL_MASK32 1 /* 32 bit emulation */ | ||||
#endif | #endif | ||||
/* | /* | ||||
* This describes the access space for a sysctl request. This is needed | * This describes the access space for a sysctl request. This is needed | ||||
* so that we can use the interface from the kernel or from user-space. | * so that we can use the interface from the kernel or from user-space. | ||||
*/ | */ | ||||
struct thread; | |||||
struct sysctl_req { | struct sysctl_req { | ||||
struct thread *td; /* used for access checking */ | struct thread *td; /* used for access checking */ | ||||
int lock; /* wiring state */ | int lock; /* wiring state */ | ||||
void *oldptr; | void *oldptr; | ||||
size_t oldlen; | size_t oldlen; | ||||
size_t oldidx; | size_t oldidx; | ||||
int (*oldfunc)(struct sysctl_req *, const void *, size_t); | int (*oldfunc)(struct sysctl_req *, const void *, size_t); | ||||
const void *newptr; | const void *newptr; | ||||
▲ Show 20 Lines • Show All 1,022 Lines • Show Last 20 Lines |