- fix comment sentence capitalization.
- whitespace cleanup. No functional changes.
This commit is contained in:
parent
917131a2cf
commit
e221af6ac2
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: init_sysctl.c,v 1.109 2007/10/15 14:12:55 ad Exp $ */
|
/* $NetBSD: init_sysctl.c,v 1.110 2007/10/16 16:05:50 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||||
|
@ -17,8 +17,8 @@
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the NetBSD
|
* This product includes software developed by the NetBSD
|
||||||
* Foundation, Inc. and its contributors.
|
* Foundation, Inc. and its contributors.
|
||||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||||
* contributors may be used to endorse or promote products derived
|
* contributors may be used to endorse or promote products derived
|
||||||
* from this software without specific prior written permission.
|
* from this software without specific prior written permission.
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.109 2007/10/15 14:12:55 ad Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.110 2007/10/16 16:05:50 christos Exp $");
|
||||||
|
|
||||||
#include "opt_sysv.h"
|
#include "opt_sysv.h"
|
||||||
#include "opt_multiprocessor.h"
|
#include "opt_multiprocessor.h"
|
||||||
|
@ -208,8 +208,8 @@ static void fill_file(struct kinfo_file *, const struct file *, struct proc *,
|
||||||
* ********************************************************************
|
* ********************************************************************
|
||||||
* section 1: setup routines
|
* section 1: setup routines
|
||||||
* ********************************************************************
|
* ********************************************************************
|
||||||
* these functions are stuffed into a link set for sysctl setup
|
* These functions are stuffed into a link set for sysctl setup
|
||||||
* functions. they're never called or referenced from anywhere else.
|
* functions. They're never called or referenced from anywhere else.
|
||||||
* ********************************************************************
|
* ********************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1028,7 +1028,7 @@ SYSCTL_SETUP(sysctl_debug_setup, "sysctl debug subtree setup")
|
||||||
|
|
||||||
node debug
|
node debug
|
||||||
node debug.0
|
node debug.0
|
||||||
string debug.0.name
|
string debug.0.name
|
||||||
int debug.0.value
|
int debug.0.value
|
||||||
int debug.name
|
int debug.name
|
||||||
|
|
||||||
|
@ -1099,7 +1099,7 @@ sysctl_kern_trigger_panic(SYSCTLFN_ARGS)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.maxvnodes. drain vnodes if
|
* sysctl helper routine for kern.maxvnodes. Drain vnodes if
|
||||||
* new value is lower than desiredvnodes and then calls reinit
|
* new value is lower than desiredvnodes and then calls reinit
|
||||||
* routines that needs to adjust to the new value.
|
* routines that needs to adjust to the new value.
|
||||||
*/
|
*/
|
||||||
|
@ -1167,7 +1167,7 @@ sysctl_kern_rtc_offset(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.maxproc. ensures that the new
|
* sysctl helper routine for kern.maxproc. Ensures that the new
|
||||||
* values are not too low or too high.
|
* values are not too low or too high.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1195,7 +1195,7 @@ sysctl_kern_maxproc(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper function for kern.hostid. the hostid is a long, but
|
* sysctl helper function for kern.hostid. The hostid is a long, but
|
||||||
* we export it as an int, so we need to give it a little help.
|
* we export it as an int, so we need to give it a little help.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1243,7 +1243,7 @@ sysctl_setlen(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.clockrate. assembles a struct on
|
* sysctl helper routine for kern.clockrate. Assembles a struct on
|
||||||
* the fly to be returned to the caller.
|
* the fly to be returned to the caller.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1320,8 +1320,8 @@ sysctl_kern_file(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.msgbufsize and kern.msgbuf. for the
|
* sysctl helper routine for kern.msgbufsize and kern.msgbuf. For the
|
||||||
* former it merely checks the message buffer is set up. for the latter,
|
* former it merely checks the message buffer is set up. For the latter,
|
||||||
* it also copies out the data if necessary.
|
* it also copies out the data if necessary.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1353,11 +1353,11 @@ sysctl_msgbuf(SYSCTLFN_ARGS)
|
||||||
if (newp != NULL)
|
if (newp != NULL)
|
||||||
return (EPERM);
|
return (EPERM);
|
||||||
|
|
||||||
if (oldp == NULL) {
|
if (oldp == NULL) {
|
||||||
/* always return full buffer size */
|
/* always return full buffer size */
|
||||||
*oldlenp = msgbufp->msg_bufs;
|
*oldlenp = msgbufp->msg_bufs;
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
maxlen = MIN(msgbufp->msg_bufs, *oldlenp);
|
maxlen = MIN(msgbufp->msg_bufs, *oldlenp);
|
||||||
|
@ -1390,7 +1390,7 @@ sysctl_msgbuf(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.defcorename. in the case of a new
|
* sysctl helper routine for kern.defcorename. In the case of a new
|
||||||
* string being assigned, check that it's not a zero-length string.
|
* string being assigned, check that it's not a zero-length string.
|
||||||
* (XXX the check in -current doesn't work, but do we really care?)
|
* (XXX the check in -current doesn't work, but do we really care?)
|
||||||
*/
|
*/
|
||||||
|
@ -1412,7 +1412,7 @@ sysctl_kern_defcorename(SYSCTLFN_ARGS)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* when sysctl_lookup() deals with a string, it's guaranteed
|
* when sysctl_lookup() deals with a string, it's guaranteed
|
||||||
* to come back nul terminated. so there. :)
|
* to come back nul terminated. So there. :)
|
||||||
*/
|
*/
|
||||||
if (strlen(newcorename) == 0) {
|
if (strlen(newcorename) == 0) {
|
||||||
error = EINVAL;
|
error = EINVAL;
|
||||||
|
@ -1426,7 +1426,7 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.cp_time node. adds up cpu time
|
* sysctl helper routine for kern.cp_time node. Adds up cpu time
|
||||||
* across all cpus.
|
* across all cpus.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1466,7 +1466,7 @@ sysctl_kern_cptime(SYSCTLFN_ARGS)
|
||||||
*/
|
*/
|
||||||
switch (namelen) {
|
switch (namelen) {
|
||||||
case 0:
|
case 0:
|
||||||
if (*oldlenp == sizeof(uint64_t) * CPUSTATES || oldp == NULL) {
|
if (*oldlenp == sizeof(uint64_t) * CPUSTATES || oldp == NULL) {
|
||||||
node.sysctl_size = sizeof(uint64_t) * CPUSTATES;
|
node.sysctl_size = sizeof(uint64_t) * CPUSTATES;
|
||||||
n = -1; /* SUM */
|
n = -1; /* SUM */
|
||||||
}
|
}
|
||||||
|
@ -1528,7 +1528,7 @@ sysctl_kern_cptime(SYSCTLFN_ARGS)
|
||||||
|
|
||||||
#if NPTY > 0
|
#if NPTY > 0
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.maxptys. ensures that any new value
|
* sysctl helper routine for kern.maxptys. Ensures that any new value
|
||||||
* is acceptable to the pty subsystem.
|
* is acceptable to the pty subsystem.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1555,7 +1555,7 @@ sysctl_kern_maxptys(SYSCTLFN_ARGS)
|
||||||
#endif /* NPTY > 0 */
|
#endif /* NPTY > 0 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.sbmax. basically just ensures that
|
* sysctl helper routine for kern.sbmax. Basically just ensures that
|
||||||
* any new value is not too small.
|
* any new value is not too small.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1577,7 +1577,7 @@ sysctl_kern_sbmax(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.urandom node. picks a random number
|
* sysctl helper routine for kern.urandom node. Picks a random number
|
||||||
* for you.
|
* for you.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1599,7 +1599,7 @@ sysctl_kern_urnd(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.arandom node. picks a random number
|
* sysctl helper routine for kern.arandom node. Picks a random number
|
||||||
* for you.
|
* for you.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -1681,7 +1681,7 @@ sysctl_kern_lwp(SYSCTLFN_ARGS)
|
||||||
mutex_exit(&proclist_lock);
|
mutex_exit(&proclist_lock);
|
||||||
return (ESRCH);
|
return (ESRCH);
|
||||||
}
|
}
|
||||||
mutex_enter(&p->p_smutex);
|
mutex_enter(&p->p_smutex);
|
||||||
LIST_FOREACH(l2, &p->p_lwps, l_sibling) {
|
LIST_FOREACH(l2, &p->p_lwps, l_sibling) {
|
||||||
if (buflen >= elem_size && elem_count > 0) {
|
if (buflen >= elem_size && elem_count > 0) {
|
||||||
struct lwp *l3;
|
struct lwp *l3;
|
||||||
|
@ -1734,7 +1734,7 @@ sysctl_kern_lwp(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.forkfsleep node. ensures that the
|
* sysctl helper routine for kern.forkfsleep node. Ensures that the
|
||||||
* given value is not too large or two small, and is at least one
|
* given value is not too large or two small, and is at least one
|
||||||
* timer tick if not zero.
|
* timer tick if not zero.
|
||||||
*/
|
*/
|
||||||
|
@ -1973,7 +1973,7 @@ fill_file(struct kinfo_file *kp, const struct file *fp, struct proc *p, int i)
|
||||||
kp->ki_vdata = PTRTOUINT64(vp->v_data);
|
kp->ki_vdata = PTRTOUINT64(vp->v_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process information when retrieved via KERN_FILE_BYPID */
|
/* process information when retrieved via KERN_FILE_BYPID */
|
||||||
if (p) {
|
if (p) {
|
||||||
kp->ki_pid = p->p_pid;
|
kp->ki_pid = p->p_pid;
|
||||||
kp->ki_fd = i;
|
kp->ki_fd = i;
|
||||||
|
@ -2344,7 +2344,7 @@ sysctl_kern_proc_args(SYSCTLFN_ARGS)
|
||||||
if (error)
|
if (error)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now copy each string.
|
* Now copy each string.
|
||||||
*/
|
*/
|
||||||
len = 0; /* bytes written to user buffer */
|
len = 0; /* bytes written to user buffer */
|
||||||
|
@ -2392,12 +2392,12 @@ sysctl_kern_proc_args(SYSCTLFN_ARGS)
|
||||||
/* Check for user buffer overflow */
|
/* Check for user buffer overflow */
|
||||||
if (len + xlen > *oldlenp) {
|
if (len + xlen > *oldlenp) {
|
||||||
finished = 1;
|
finished = 1;
|
||||||
if (len > *oldlenp)
|
if (len > *oldlenp)
|
||||||
xlen = 0;
|
xlen = 0;
|
||||||
else
|
else
|
||||||
xlen = *oldlenp - len;
|
xlen = *oldlenp - len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copyout the page */
|
/* Copyout the page */
|
||||||
error = dcopyout(l, arg, (char *)oldp + len, xlen);
|
error = dcopyout(l, arg, (char *)oldp + len, xlen);
|
||||||
if (error)
|
if (error)
|
||||||
|
@ -2476,7 +2476,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.cp_id node. maps cpus to their
|
* sysctl helper routine for kern.cp_id node. Maps cpus to their
|
||||||
* cpuids.
|
* cpuids.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -2508,8 +2508,8 @@ sysctl_kern_cpid(SYSCTLFN_ARGS)
|
||||||
CPU_INFO_ITERATOR cii;
|
CPU_INFO_ITERATOR cii;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* here you may either retrieve a single cpu id or the whole
|
* Here you may either retrieve a single cpu id or the whole
|
||||||
* set. the size you get back when probing depends on what
|
* set. The size you get back when probing depends on what
|
||||||
* you ask for.
|
* you ask for.
|
||||||
*/
|
*/
|
||||||
switch (namelen) {
|
switch (namelen) {
|
||||||
|
@ -2568,7 +2568,7 @@ sysctl_kern_cpid(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for hw.usermem and hw.usermem64. values are
|
* sysctl helper routine for hw.usermem and hw.usermem64. Values are
|
||||||
* calculate on the fly taking into account integer overflow and the
|
* calculate on the fly taking into account integer overflow and the
|
||||||
* current wired count.
|
* current wired count.
|
||||||
*/
|
*/
|
||||||
|
@ -2600,7 +2600,7 @@ sysctl_hw_usermem(SYSCTLFN_ARGS)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.cnmagic node. pulls the old value
|
* sysctl helper routine for kern.cnmagic node. Pulls the old value
|
||||||
* out, encoded, and stuffs the new value in for decoding.
|
* out, encoded, and stuffs the new value in for decoding.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -2645,7 +2645,7 @@ sysctl_root_device(SYSCTLFN_ARGS)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sysctl helper routine for kern.consdev, dependent on the current
|
* sysctl helper routine for kern.consdev, dependent on the current
|
||||||
* state of the console. also used for machdep.console_device on some
|
* state of the console. Also used for machdep.console_device on some
|
||||||
* ports.
|
* ports.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue