version 1.12.2.4, 1993/11/29 16:03:22 |
version 1.13, 1993/11/20 01:57:07 |
|
|
* Kernel parameter filesystem |
* Kernel parameter filesystem |
*/ |
*/ |
|
|
#include <sys/param.h> |
#include "param.h" |
#include <sys/systm.h> |
#include "systm.h" |
#include <sys/kernel.h> |
#include "kernel.h" |
#include <sys/types.h> |
#include "types.h" |
#include <sys/time.h> |
#include "time.h" |
#include <sys/proc.h> |
#include "proc.h" |
#include <sys/file.h> |
#include "file.h" |
#include <sys/vnode.h> |
#include "vnode.h" |
#include <sys/stat.h> |
#include "stat.h" |
#include <sys/mount.h> |
#include "mount.h" |
#include <sys/namei.h> |
#include "namei.h" |
#include <sys/buf.h> |
#include "buf.h" |
#include <miscfs/kernfs/kernfs.h> |
#include "miscfs/kernfs/kernfs.h" |
|
|
#include <ufs/dir.h> /* For readdir() XXX */ |
#include "../ufs/dir.h" /* For readdir() XXX */ |
|
|
struct kernfs_target kernfs_targets[] = { |
struct kernfs_target kernfs_targets[] = { |
/* NOTE: The name must be less than UIO_MX-16 chars in length */ |
/* NOTE: The name must be less than UIO_MX-16 chars in length */ |
Line 125 kernfs_xread(kt, buf, len, lenp) |
|
Line 125 kernfs_xread(kt, buf, len, lenp) |
|
|
|
case KTT_AVENRUN: |
case KTT_AVENRUN: |
sprintf(buf, "%d %d %d %d\n", |
sprintf(buf, "%d %d %d %d\n", |
averunnable.ldavg[0], |
averunnable[0], |
averunnable.ldavg[1], |
averunnable[1], |
averunnable.ldavg[2], |
averunnable[2], |
FSCALE); |
FSCALE); |
break; |
break; |
|
|
Line 202 kernfs_lookup(dvp, ndp, p) |
|
Line 202 kernfs_lookup(dvp, ndp, p) |
|
* /kern/rootdev is the root device |
* /kern/rootdev is the root device |
*/ |
*/ |
if (ndp->ni_namelen == 7 && bcmp(pname, "rootdev", 7) == 0) { |
if (ndp->ni_namelen == 7 && bcmp(pname, "rootdev", 7) == 0) { |
if (!rootvp) { |
if (vfinddev(rootdev, VBLK, &fvp)) |
error = ENOENT; |
return (ENXIO); |
goto bad; |
|
} |
|
ndp->ni_dvp = dvp; |
ndp->ni_dvp = dvp; |
ndp->ni_vp = rootvp; |
ndp->ni_vp = fvp; |
VREF(rootvp); |
VREF(fvp); |
VOP_LOCK(rootvp); |
VOP_LOCK(fvp); |
return (0); |
return (0); |
} |
} |
|
|
/* |
/* |
* /kern/rrootdev is the raw root device |
* /kern/rrootdev is the root device |
*/ |
*/ |
if (ndp->ni_namelen == 8 && bcmp(pname, "rrootdev", 7) == 0) { |
if (ndp->ni_namelen == 8 && bcmp(pname, "rrootdev", 7) == 0) { |
if (!rrootdevvp) { |
|
error = ENOENT; |
|
goto bad; |
|
} |
|
ndp->ni_dvp = dvp; |
ndp->ni_dvp = dvp; |
ndp->ni_vp = rrootdevvp; |
ndp->ni_vp = rrootdevvp; |
VREF(rrootdevvp); |
VREF(rrootdevvp); |