sysctl.h

来自「基于组件方式开发操作系统的OSKIT源代码」· C头文件 代码 · 共 681 行 · 第 1/2 页

H
681
字号
	int32_t	p_schedflags;		/* INT: PSCHED_* flags */	u_int64_t p_uticks;		/* U_QUAD_T: Statclock hits in user mode. */	u_int64_t p_sticks;		/* U_QUAD_T: Statclock hits in system mode. */	u_int64_t p_iticks;		/* U_QUAD_T: Statclock hits processing intr. */	u_int64_t p_tracep;		/* PTR: Trace to vnode or file */	int32_t	p_traceflag;		/* INT: Kernel trace points. */	int32_t	p_holdcnt;              /* INT: If non-zero, don't swap. */	ki_sigset_t p_siglist;		/* SIGSET_T: Signals arrived but not delivered. */	ki_sigset_t p_sigmask;		/* SIGSET_T: Current signal mask. */	ki_sigset_t p_sigignore;	/* SIGSET_T: Signals being ignored. */	ki_sigset_t p_sigcatch;		/* SIGSET_T: Signals being caught by user. */	int8_t	p_stat;			/* CHAR: S* process status. */	u_int8_t p_priority;		/* U_CHAR: Process priority. */	u_int8_t p_usrpri;		/* U_CHAR: User-priority based on p_cpu and p_nice. */	u_int8_t p_nice;		/* U_CHAR: Process "nice" value. */	u_int16_t p_xstat;		/* U_SHORT: Exit status for wait; also stop signal. */	u_int16_t p_acflag;		/* U_SHORT: Accounting flags. */	char	p_comm[KI_MAXCOMLEN];	char	p_wmesg[KI_WMESGLEN];	/* wchan message */	u_int64_t p_wchan;		/* PTR: sleep address. */	char	p_login[KI_MAXLOGNAME];	/* setlogin() name */	int32_t	p_vm_rssize;		/* SEGSZ_T: current resident set size in pages */	int32_t	p_vm_tsize;		/* SEGSZ_T: text size (pages) */	int32_t	p_vm_dsize;		/* SEGSZ_T: data size (pages) */	int32_t	p_vm_ssize;		/* SEGSZ_T: stack size (pages) */	int64_t	p_uvalid;		/* CHAR: following p_u* members from struct user are valid */					/* XXX 64 bits for alignment */	u_int32_t p_ustart_sec;		/* STRUCT TIMEVAL: starting time. */	u_int32_t p_ustart_usec;	/* STRUCT TIMEVAL: starting time. */	u_int32_t p_uutime_sec;		/* STRUCT TIMEVAL: user time. */	u_int32_t p_uutime_usec;	/* STRUCT TIMEVAL: user time. */	u_int32_t p_ustime_sec;		/* STRUCT TIMEVAL: system time. */	u_int32_t p_ustime_usec;	/* STRUCT TIMEVAL: system time. */	u_int64_t p_uru_maxrss;		/* LONG: max resident set size. */	u_int64_t p_uru_ixrss;		/* LONG: integral shared memory size. */	u_int64_t p_uru_idrss;		/* LONG: integral unshared data ". */	u_int64_t p_uru_isrss;		/* LONG: integral unshared stack ". */	u_int64_t p_uru_minflt;		/* LONG: page reclaims. */	u_int64_t p_uru_majflt;		/* LONG: page faults. */	u_int64_t p_uru_nswap;		/* LONG: swaps. */	u_int64_t p_uru_inblock;	/* LONG: block input operations. */	u_int64_t p_uru_oublock;	/* LONG: block output operations. */	u_int64_t p_uru_msgsnd;		/* LONG: messages sent. */	u_int64_t p_uru_msgrcv;		/* LONG: messages received. */	u_int64_t p_uru_nsignals;	/* LONG: signals received. */	u_int64_t p_uru_nvcsw;		/* LONG: voluntary context switches. */	u_int64_t p_uru_nivcsw;		/* LONG: involuntary ". */	u_int32_t p_uctime_sec;		/* STRUCT TIMEVAL: child u+s time. */	u_int32_t p_uctime_usec;	/* STRUCT TIMEVAL: child u+s time. */	u_int64_t p_cpuid;		/* LONG: cpu id */};/* * KERN_PROC_ARGS subtypes */#define	KERN_PROC_ARGV		1	/* argv */#define	KERN_PROC_NARGV		2	/* number of strings in above */#define	KERN_PROC_ENV		3	/* environ */#define	KERN_PROC_NENV		4	/* number of strings in above *//* * KERN_SYSVIPC_INFO subtypes */#define	KERN_SYSVIPC_MSG_INFO		1	/* msginfo and msqid_ds */#define	KERN_SYSVIPC_SEM_INFO		2	/* seminfo and semid_ds */#define	KERN_SYSVIPC_SHM_INFO		3	/* shminfo and shmid_ds *//* * CTL_HW identifiers */#define	HW_MACHINE	 1		/* string: machine class */#define	HW_MODEL	 2		/* string: specific machine model */#define	HW_NCPU		 3		/* int: number of cpus */#define	HW_BYTEORDER	 4		/* int: machine byte order */#define	HW_PHYSMEM	 5		/* int: total memory */#define	HW_USERMEM	 6		/* int: non-kernel memory */#define	HW_PAGESIZE	 7		/* int: software page size */#define	HW_DISKNAMES	 8		/* strings: disk drive names */#define	HW_DISKSTATS	 9		/* struct: diskstats[] */#define	HW_MACHINE_ARCH	10		/* string: machine architecture */#define	HW_ALIGNBYTES	11		/* int: ALIGNBYTES for the kernel */#define	HW_CNMAGIC	12		/* string: console magic sequence(s) */#define	HW_MAXID	13		/* number of valid hw ids */#define	CTL_HW_NAMES { \	{ 0, 0 }, \	{ "machine", CTLTYPE_STRING }, \	{ "model", CTLTYPE_STRING }, \	{ "ncpu", CTLTYPE_INT }, \	{ "byteorder", CTLTYPE_INT }, \	{ "physmem", CTLTYPE_INT }, \	{ "usermem", CTLTYPE_INT }, \	{ "pagesize", CTLTYPE_INT }, \	{ "disknames", CTLTYPE_STRUCT }, \	{ "diskstats", CTLTYPE_STRUCT }, \	{ "machine_arch", CTLTYPE_STRING }, \	{ "alignbytes", CTLTYPE_INT }, \	{ "cnmagic", CTLTYPE_STRING }, \}/* * CTL_USER definitions */#define	USER_CS_PATH		 1	/* string: _CS_PATH */#define	USER_BC_BASE_MAX	 2	/* int: BC_BASE_MAX */#define	USER_BC_DIM_MAX		 3	/* int: BC_DIM_MAX */#define	USER_BC_SCALE_MAX	 4	/* int: BC_SCALE_MAX */#define	USER_BC_STRING_MAX	 5	/* int: BC_STRING_MAX */#define	USER_COLL_WEIGHTS_MAX	 6	/* int: COLL_WEIGHTS_MAX */#define	USER_EXPR_NEST_MAX	 7	/* int: EXPR_NEST_MAX */#define	USER_LINE_MAX		 8	/* int: LINE_MAX */#define	USER_RE_DUP_MAX		 9	/* int: RE_DUP_MAX */#define	USER_POSIX2_VERSION	10	/* int: POSIX2_VERSION */#define	USER_POSIX2_C_BIND	11	/* int: POSIX2_C_BIND */#define	USER_POSIX2_C_DEV	12	/* int: POSIX2_C_DEV */#define	USER_POSIX2_CHAR_TERM	13	/* int: POSIX2_CHAR_TERM */#define	USER_POSIX2_FORT_DEV	14	/* int: POSIX2_FORT_DEV */#define	USER_POSIX2_FORT_RUN	15	/* int: POSIX2_FORT_RUN */#define	USER_POSIX2_LOCALEDEF	16	/* int: POSIX2_LOCALEDEF */#define	USER_POSIX2_SW_DEV	17	/* int: POSIX2_SW_DEV */#define	USER_POSIX2_UPE		18	/* int: POSIX2_UPE */#define	USER_STREAM_MAX		19	/* int: POSIX2_STREAM_MAX */#define	USER_TZNAME_MAX		20	/* int: POSIX2_TZNAME_MAX */#define	USER_MAXID		21	/* number of valid user ids */#define	CTL_USER_NAMES { \	{ 0, 0 }, \	{ "cs_path", CTLTYPE_STRING }, \	{ "bc_base_max", CTLTYPE_INT }, \	{ "bc_dim_max", CTLTYPE_INT }, \	{ "bc_scale_max", CTLTYPE_INT }, \	{ "bc_string_max", CTLTYPE_INT }, \	{ "coll_weights_max", CTLTYPE_INT }, \	{ "expr_nest_max", CTLTYPE_INT }, \	{ "line_max", CTLTYPE_INT }, \	{ "re_dup_max", CTLTYPE_INT }, \	{ "posix2_version", CTLTYPE_INT }, \	{ "posix2_c_bind", CTLTYPE_INT }, \	{ "posix2_c_dev", CTLTYPE_INT }, \	{ "posix2_char_term", CTLTYPE_INT }, \	{ "posix2_fort_dev", CTLTYPE_INT }, \	{ "posix2_fort_run", CTLTYPE_INT }, \	{ "posix2_localedef", CTLTYPE_INT }, \	{ "posix2_sw_dev", CTLTYPE_INT }, \	{ "posix2_upe", CTLTYPE_INT }, \	{ "stream_max", CTLTYPE_INT }, \	{ "tzname_max", CTLTYPE_INT }, \}/* * CTL_DDB definitions */#define	DDBCTL_RADIX		1	/* int: Input and output radix */#define	DDBCTL_MAXOFF		2	/* int: max symbol offset */#define	DDBCTL_MAXWIDTH		3	/* int: width of the display line */#define	DDBCTL_LINES		4	/* int: number of display lines */#define	DDBCTL_TABSTOPS		5	/* int: tab width */#define	DDBCTL_ONPANIC		6	/* int: DDB on panic if non-zero */#define	DDBCTL_FROMCONSOLE	7	/* int: DDB via console if non-zero */#define	DDBCTL_MAXID		8	/* number of valid DDB ids */#define	CTL_DDB_NAMES { \	{ 0, 0 }, \	{ "radix", CTLTYPE_INT }, \	{ "maxoff", CTLTYPE_INT }, \	{ "maxwidth", CTLTYPE_INT }, \	{ "lines", CTLTYPE_INT }, \	{ "tabstops", CTLTYPE_INT }, \	{ "onpanic", CTLTYPE_INT }, \	{ "fromconsole", CTLTYPE_INT }, \}/* * CTL_DEBUG definitions * * Second level identifier specifies which debug variable. * Third level identifier specifies which stucture component. */#define	CTL_DEBUG_NAME		0	/* string: variable name */#define	CTL_DEBUG_VALUE		1	/* int: variable value */#define	CTL_DEBUG_MAXID		20/* * CTL_PROC subtype. Either a PID, or a magic value for the current proc. */#define	PROC_CURPROC	(~((u_int)1 << 31))/* * CTL_PROC tree: either corename (string), or a limit * (rlimit.<type>.{hard,soft}, int). */#define	PROC_PID_CORENAME	1#define	PROC_PID_LIMIT		2#define	PROC_PID_MAXID		3#define	PROC_PID_NAMES { \	{ 0, 0 }, \	{ "corename", CTLTYPE_STRING }, \	{ "rlimit", CTLTYPE_NODE }, \}/* Limit types from <sys/resources.h> */#define	PROC_PID_LIMIT_CPU	(RLIMIT_CPU+1)#define	PROC_PID_LIMIT_FSIZE	(RLIMIT_FSIZE+1)#define	PROC_PID_LIMIT_DATA	(RLIMIT_DATA+1)#define	PROC_PID_LIMIT_STACK	(RLIMIT_STACK+1)#define	PROC_PID_LIMIT_CORE	(RLIMIT_CORE+1)#define	PROC_PID_LIMIT_RSS	(RLIMIT_RSS+1)#define	PROC_PID_LIMIT_MEMLOCK	(RLIMIT_MEMLOCK+1)#define PROC_PID_LIMIT_NPROC	(RLIMIT_NPROC+1)#define	PROC_PID_LIMIT_NOFILE	(RLIMIT_NOFILE+1)#define	PROC_PID_LIMIT_MAXID 	10#define	PROC_PID_LIMIT_NAMES { \	{ 0, 0 }, \	{ "cputime", CTLTYPE_NODE }, \	{ "filesize", CTLTYPE_NODE }, \	{ "datasize", CTLTYPE_NODE }, \	{ "stacksize", CTLTYPE_NODE }, \	{ "coredumpsize", CTLTYPE_NODE }, \	{ "memoryuse", CTLTYPE_NODE }, \	{ "memorylocked", CTLTYPE_NODE }, \	{ "maxproc", CTLTYPE_NODE }, \	{ "descriptors", CTLTYPE_NODE }, \}/* for each type, either hard or soft value */#define	PROC_PID_LIMIT_TYPE_SOFT	1#define	PROC_PID_LIMIT_TYPE_HARD	2#define	PROC_PID_LIMIT_TYPE_MAXID	3#define	PROC_PID_LIMIT_TYPE_NAMES { \	{0, 0}, \	{ "soft", CTLTYPE_QUAD }, \	{ "hard", CTLTYPE_QUAD }, \}#ifdef	_KERNEL/* * CTL_DEBUG variables. * * These are declared as separate variables so that they can be * individually initialized at the location of their associated * variable. The loader prevents multiple use by issuing errors * if a variable is initialized in more than one place. They are * aggregated into an array in debug_sysctl(), so that it can * conveniently locate them when querried. If more debugging * variables are added, they must also be declared here and also * entered into the array. */struct ctldebug {	char	*debugname;	/* name of debugging variable */	int	*debugvar;	/* pointer to debugging variable */};#ifdef	DEBUGextern struct ctldebug debug0, debug1, debug2, debug3, debug4;extern struct ctldebug debug5, debug6, debug7, debug8, debug9;extern struct ctldebug debug10, debug11, debug12, debug13, debug14;extern struct ctldebug debug15, debug16, debug17, debug18, debug19;#endif	/* DEBUG *//* * Internal sysctl function calling convention: * *	(*sysctlfn)(name, namelen, oldval, oldlenp, newval, newlen); * * The name parameter points at the next component of the name to be * interpreted.  The namelen parameter is the number of integers in * the name. */typedef int (sysctlfn)    __P((int *, u_int, void *, size_t *, void *, size_t, struct proc *));int sysctl_int __P((void *, size_t *, void *, size_t, int *));int sysctl_rdint __P((void *, size_t *, void *, int));int sysctl_quad __P((void *, size_t *, void *, size_t, quad_t *));int sysctl_rdquad __P((void *, size_t *, void *, quad_t));int sysctl_string __P((void *, size_t *, void *, size_t, char *, int));int sysctl_rdstring __P((void *, size_t *, void *, const char *));int sysctl_struct __P((void *, size_t *, void *, size_t, void *, int));int sysctl_rdstruct __P((void *, size_t *, void *, const void *, int));int sysctl_rdminstruct __P((void *, size_t *, void *, const void *, int));struct radix_node;struct walkarg;int sysctl_clockrate __P((void *, size_t *));int sysctl_vnode __P((char *, size_t *, struct proc *));int sysctl_ntptime __P((void *, size_t *));#ifdef GPROFint sysctl_doprof __P((int *, u_int, void *, size_t *, void *, size_t));#endifint sysctl_dombuf __P((int *, u_int, void *, size_t *, void *, size_t));void fill_eproc __P((struct proc *, struct eproc *));int kern_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		     struct proc *));int hw_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		   struct proc *));int proc_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		     struct proc *));#ifdef DEBUGint debug_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		      struct proc *));#endifint net_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		    struct proc *));int cpu_sysctl __P((int *, u_int, void *, size_t *, void *, size_t,		    struct proc *));/* ddb_sysctl() declared in ddb_var.h */void	sysctl_init(void);#ifdef __SYSCTL_PRIVATEextern struct lock sysctl_memlock;#endif#else	/* !_KERNEL */#include <sys/cdefs.h>__BEGIN_DECLSint	sysctl __P((int *, u_int, void *, size_t *, const void *, size_t));__END_DECLS#endif	/* _KERNEL */#endif	/* !_SYS_SYSCTL_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?