Add a sysctl to frob sb_max.

This commit is contained in:
thorpej 2001-07-27 21:19:09 +00:00
parent d8372315a2
commit 9e74a14e1f
2 changed files with 19 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.92 2001/07/14 06:36:01 matt Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.93 2001/07/27 21:19:09 thorpej Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -70,6 +70,7 @@
#include <sys/tty.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/socketvar.h>
#define __SYSCTL_PRIVATE
#include <sys/sysctl.h>
#include <sys/lock.h>
@ -535,7 +536,19 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
newp, newlen));
#endif
case KERN_MAXPHYS:
return sysctl_rdint(oldp, oldlenp, newp, MAXPHYS);
return (sysctl_rdint(oldp, oldlenp, newp, MAXPHYS));
case KERN_SBMAX:
{
int new_sbmax = sb_max;
error = sysctl_int(oldp, oldlenp, newp, newlen, &new_sbmax);
if (error == 0) {
if (new_sbmax < (16 * 1024)) /* sanity */
return (EINVAL);
sb_max = new_sbmax;
}
return (error);
}
default:
return (EOPNOTSUPP);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sysctl.h,v 1.66 2001/07/14 06:36:02 matt Exp $ */
/* $NetBSD: sysctl.h,v 1.67 2001/07/27 21:19:09 thorpej Exp $ */
/*
* Copyright (c) 1989, 1993
@ -175,7 +175,8 @@ struct ctlname {
#define KERN_MAXPTYS 55 /* int: maximum number of ptys */
#define KERN_PIPE 56 /* node: pipe limits */
#define KERN_MAXPHYS 57 /* int: kernel value of MAXPHYS */
#define KERN_MAXID 58 /* number of valid kern ids */
#define KERN_SBMAX 58 /* int: max socket buffer size */
#define KERN_MAXID 59 /* number of valid kern ids */
#define CTL_KERN_NAMES { \
{ 0, 0 }, \
@ -236,6 +237,7 @@ struct ctlname {
{ "maxptys", CTLTYPE_INT }, \
{ "pipe", CTLTYPE_NODE }, \
{ "maxphys", CTLTYPE_INT }, \
{ "sbmax", CTLTYPE_INT }, \
}
/*