diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-15 17:59:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-15 17:59:46 +0000 |
commit | 2a29d7700a247438440c4d033492a4dee76c40ff (patch) | |
tree | 5158a1f02565b3f098b38d2f75b6d69863ecef73 | |
parent | a580ebf56a93a94895ee636e404c450044734a96 (diff) |
No you cannot remove a sysctl mib once you add it. It becomes ABI. That
is how sysctl finds them, so it can *never* be renumbered again, and must
stay
-rw-r--r-- | sys/kern/kern_sysctl.c | 11 | ||||
-rw-r--r-- | sys/sys/sysctl.h | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 3844f123316..313fb8402f0 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.174 2009/06/15 17:01:26 beck Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.175 2009/06/15 17:59:45 deraadt Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -554,6 +554,15 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, case KERN_CPTIME2: return (sysctl_cptime2(name + 1, namelen -1, oldp, oldlenp, newp, newlen)); + case KERN_CACHEPCT: { + int opct = 0; + + error = sysctl_int(oldp, oldlenp, newp, newlen, + &opct); + if (error) + return(error); + return(0); + } default: return (EOPNOTSUPP); } diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index b1cf095d9cf..7741e43f3a7 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.h,v 1.99 2009/06/15 17:01:26 beck Exp $ */ +/* $OpenBSD: sysctl.h,v 1.100 2009/06/15 17:59:44 deraadt Exp $ */ /* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */ /* @@ -184,8 +184,9 @@ struct ctlname { #define KERN_TIMECOUNTER 69 /* node: timecounter */ #define KERN_MAXLOCKSPERUID 70 /* int: locks per uid */ #define KERN_CPTIME2 71 /* array: cp_time2 */ -#define KERN_FILE2 72 /* struct: file entries */ -#define KERN_MAXID 73 /* number of valid kern ids */ +#define KERN_CACHEPCT 72 /* buffer cache % of physmem */ +#define KERN_FILE2 73 /* struct: file entries */ +#define KERN_MAXID 74 /* number of valid kern ids */ #define CTL_KERN_NAMES { \ { 0, 0 }, \ @@ -260,6 +261,7 @@ struct ctlname { { "timecounter", CTLTYPE_NODE }, \ { "maxlocksperuid", CTLTYPE_INT }, \ { "cp_time2", CTLTYPE_STRUCT }, \ + { "bufcachepercent", CTLTYPE_INT }, \ { "file2", CTLTYPE_STRUCT }, \ } |