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.8 (Berkeley) 02/24/91 8 */ 9 10 /* 11 * Get kernel info 12 */ 13 #define ki_op(x) ((x)&0x0000ffff) 14 #define ki_type(x) ((x)&0x0000ff00) 15 16 /* 17 * proc info 18 */ 19 #define KINFO_PROC (0<<8) 20 #define KINFO_PROC_ALL (KINFO_PROC|0) /* everything */ 21 #define KINFO_PROC_PID (KINFO_PROC|1) /* by process id */ 22 #define KINFO_PROC_PGRP (KINFO_PROC|2) /* by process group id */ 23 #define KINFO_PROC_SESSION (KINFO_PROC|3) /* by session of pid */ 24 #define KINFO_PROC_TTY (KINFO_PROC|4) /* by controlling tty */ 25 #define KINFO_PROC_UID (KINFO_PROC|5) /* by effective uid */ 26 #define KINFO_PROC_RUID (KINFO_PROC|6) /* by real uid */ 27 28 /* 29 * Routing table 30 */ 31 #define ki_af(x) (((x)&0x00ff0000) >> 16) 32 #define KINFO_RT (1<<8) 33 #define KINFO_RT_DUMP (KINFO_RT|1) /* dump; may limit to a.f. */ 34 #define KINFO_RT_FLAGS (KINFO_RT|2) /* by flags, e.g. RESOLVING */ 35 36 /* 37 * vnodes 38 */ 39 #define KINFO_VNODE (2<<8) 40 41 /* 42 * Locking and stats 43 */ 44 45 struct kinfo_lock { 46 int kl_lock; 47 int kl_want; 48 int kl_locked; 49 }; 50 51 #ifdef KERNEL 52 extern struct kinfo_lock kinfo_lock; 53 #else 54 55 #include <sys/cdefs.h> 56 57 __BEGIN_DECLS 58 int getkerninfo __P((int, void *, int *, int)); 59 __END_DECLS 60 #endif 61