From eae79dd1c0778bd3b5330ef928801f77e55bc566 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 20 Jan 1998 12:27:38 +0000 Subject: [PATCH] Merged from Lite2. This was mostly already done, mostly indirectly via wollman's changes in rev.1.2 being adopted by Lite2 and the nfsv3 changes in rev.1.3 being adopted by both FreeBSD and Lite2. We were only missing lookup of the type number for nfs (MOUNT_NFS doesn't exist in Lite2). --- usr.bin/nfsstat/nfsstat.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index a53991a2a2f..b5533fe957c 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -41,9 +41,11 @@ static char copyright[] = #endif /* not lint */ #ifndef lint -/*static char sccsid[] = "From: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93";*/ +#if 0 +static char sccsid[] = "@(#)nfsstat.c 8.2 (Berkeley) 3/31/95"; +#endif static const char rcsid[] = - "$Id: nfsstat.c,v 1.8 1997/02/22 19:56:25 peter Exp $"; + "$Id: nfsstat.c,v 1.9 1997/03/29 04:31:23 imp Exp $"; #endif /* not lint */ #include @@ -162,12 +164,14 @@ readstats(stp) } 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] = MOUNT_NFS; + name[1] = vfc.vfc_typenum; name[2] = NFS_NFSSTATS; - - if(sysctl(name, 3, stp, &buflen, (void *)0, (size_t)0) < 0) { + if (sysctl(name, 3, stp, &buflen, (void *)0, (size_t)0) < 0) { err(1, "sysctl"); } }