diff options
author | msmith <msmith@FreeBSD.org> | 1998-10-24 19:36:52 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-10-24 19:36:52 +0000 |
commit | 81d90aa7965c8aaa275189b69d75ab9ea125e4fc (patch) | |
tree | 36551b1d23d37593bd6464a05397573a175a4a6f /usr.bin/nfsstat | |
parent | f91e4bda2aa918a363ea1d437da9ae31c63040bc (diff) | |
download | FreeBSD-src-81d90aa7965c8aaa275189b69d75ab9ea125e4fc.zip FreeBSD-src-81d90aa7965c8aaa275189b69d75ab9ea125e4fc.tar.gz |
Use sysctlbyname() to locate the vfs.nfs.nfsstats node.
Submitted by: Daniel Rock <rock@cs.uni-sb.de>
Diffstat (limited to 'usr.bin/nfsstat')
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index b5533fe..d2a13ab 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -45,7 +45,7 @@ static char copyright[] = static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95"; #endif static const char rcsid[] = - "$Id: nfsstat.c,v 1.9 1997/03/29 04:31:23 imp Exp $"; + "$Id: nfsstat.c,v 1.10 1998/01/20 12:27:38 bde Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -162,16 +162,9 @@ readstats(stp) err(1, "kvm_read"); } } else { - int name[3]; size_t buflen = sizeof *stp; - struct vfsconf vfc; - if (getvfsbyname("nfs", &vfc) < 0) - err(1, "getvfsbyname: NFS not compiled into kernel"); - name[0] = CTL_VFS; - name[1] = vfc.vfc_typenum; - name[2] = NFS_NFSSTATS; - if (sysctl(name, 3, stp, &buflen, (void *)0, (size_t)0) < 0) { + if (sysctlbyname("vfs.nfs.nfsstats", stp, &buflen, (void *)0, (size_t)0) < 0) { err(1, "sysctl"); } } |