diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-22 21:33:00 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-22 21:33:00 +0000 |
commit | 9ec5efd289d90d32215e20da84e44c2d58520617 (patch) | |
tree | 0bbb86e8c6a4c3b08344d45434ada8d7d4126089 /sys | |
parent | 5938db6b99f3318a6d269b361d6484f3ac90c82d (diff) |
provide sysctl iface for msgbuf; raadtified
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sysctl.c | 8 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c795c862ee5..8f024c25692 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.49 2001/06/03 18:40:23 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.50 2001/06/22 21:32:58 mickey Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -385,6 +385,12 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) if (!msgbufp || msgbufp->msg_magic != MSG_MAGIC) return (ENXIO); return (sysctl_rdint(oldp, oldlenp, newp, msgbufp->msg_bufs)); + case KERN_MSGBUF: + /* see note above */ + if (!msgbufp || msgbufp->msg_magic != MSG_MAGIC) + return (ENXIO); + return (sysctl_rdstruct(oldp, oldlenp, newp, msgbufp, + msgbufp->msg_bufs + sizeof(*msgbufp) - 1)); case KERN_MALLOCSTATS: return (sysctl_malloc(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, p)); diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index c4ad6959c2b..258081efb99 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.h,v 1.39 2001/06/03 04:37:58 angelos Exp $ */ +/* $OpenBSD: sysctl.h,v 1.40 2001/06/22 21:32:59 mickey Exp $ */ /* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */ /* @@ -161,7 +161,8 @@ struct ctlname { #define KERN_CCPU 45 /* int: ccpu */ #define KERN_FSCALE 46 /* int: fscale */ #define KERN_NPROCS 47 /* int: number of processes */ -#define KERN_MAXID 48 /* number of valid kern ids */ +#define KERN_MSGBUF 48 /* message buffer, KERN_MSGBUFSIZE */ +#define KERN_MAXID 49 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -212,6 +213,7 @@ struct ctlname { { "ccpu", CTLTYPE_INT }, \ { "fscale", CTLTYPE_INT }, \ { "nprocs", CTLTYPE_INT }, \ + { "msgbuf", CTLTYPE_STRUCT }, \ } /* |