implement sysctl variable kern.maxpartitions

This commit is contained in:
cgd 1995-01-25 06:08:06 +00:00
parent 4cc138dd7a
commit aff3f5b497
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.6 1994/10/30 21:47:45 cgd Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.7 1995/01/25 06:08:06 cgd Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -53,6 +53,7 @@
#include <sys/buf.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/disklabel.h>
#include <vm/vm.h>
#include <sys/sysctl.h>
@ -275,6 +276,8 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
#else
return (sysctl_rdint(oldp, oldlenp, newp, 0));
#endif
case KERN_MAXPARTITIONS:
return (sysctl_rdint(oldp, oldlenp, newp, MAXPARTITIONS));
default:
return (EOPNOTSUPP);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysctl.h,v 1.5 1994/09/16 23:57:31 deraadt Exp $ */
/* $NetBSD: sysctl.h,v 1.6 1995/01/25 06:08:12 cgd Exp $ */
/*
* Copyright (c) 1989, 1993
@ -130,7 +130,8 @@ struct ctlname {
#define KERN_SAVED_IDS 20 /* int: saved set-user/group-ID */
#define KERN_BOOTTIME 21 /* struct: time kernel was booted */
#define KERN_DOMAINNAME 22 /* string: (YP) domainname */
#define KERN_MAXID 23 /* number of valid kern ids */
#define KERN_MAXPARTITIONS 23 /* int: number of partitions/disk */
#define KERN_MAXID 24 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
@ -156,6 +157,7 @@ struct ctlname {
{ "saved_ids", CTLTYPE_INT }, \
{ "boottime", CTLTYPE_STRUCT }, \
{ "domainname", CTLTYPE_STRING }, \
{ "maxpartitions", CTLTYPE_INT }, \
}
/*