xref: /original-bsd/sys/sys/sysctl.h (revision b001ed0c)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)sysctl.h	7.4 (Berkeley) 06/28/90
8  */
9 
10 /*
11  * Get kernel info
12  */
13 
14 #define ki_op(x)		((x)&0x0000ffff)
15 #define ki_type(x)		((x)&0x0000ff00)
16 
17 /*
18  * proc info
19  */
20 #define	KINFO_PROC		(0<<8)
21 #define KINFO_PROC_ALL	(KINFO_PROC|0)	/* everything */
22 #define	KINFO_PROC_PID	(KINFO_PROC|1)	/* by process id */
23 #define	KINFO_PROC_PGRP	(KINFO_PROC|2)	/* by process group id */
24 #define	KINFO_PROC_SESSION (KINFO_PROC|3)	/* by session of pid */
25 #define	KINFO_PROC_TTY	(KINFO_PROC|4)	/* by controlling tty */
26 #define	KINFO_PROC_UID	(KINFO_PROC|5)	/* by effective uid */
27 #define	KINFO_PROC_RUID	(KINFO_PROC|6)	/* by real uid */
28 
29 /*
30  * Routing table
31  */
32 #define ki_af(x)		(((x)&0x00ff0000) >> 16)
33 #define KINFO_RT		(1<<8)
34 #define KINFO_RT_DUMP	(KINFO_RT|1)	/* dump; may limit to a.f. */
35 #define KINFO_RT_FLAGS	(KINFO_RT|2)	/* by flags, e.g. RESOLVING */
36 
37 /*
38  * vnodes
39  */
40 #define	KINFO_VNODE		(2<<8)
41 
42 /*
43  * Locking and stats
44  */
45 
46 struct kinfo_lock {
47 	int	kl_lock;
48 	int	kl_want;
49 	int	kl_locked;
50 };
51 
52 #ifdef KERNEL
53 extern struct kinfo_lock kinfo_lock;
54 #endif
55