From owner-freebsd-current Sun Feb 21 4:54:36 1999 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id CC7DF118BF; Sun, 21 Feb 1999 04:53:08 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.2/8.9.2) with ESMTP id NAA16216; Sun, 21 Feb 1999 13:51:31 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Bruce Evans Cc: dfr@nlsystems.com, current@FreeBSD.ORG, dfr@FreeBSD.ORG, romanp@wuppy.rcs.ru Subject: Re: Problems with nfsstat and dynamic OID In-reply-to: Your message of "Sun, 21 Feb 1999 23:32:15 +1100." <199902211232.XAA05724@godzilla.zeta.org.au> Date: Sun, 21 Feb 1999 13:51:31 +0100 Message-ID: <16214.919601491@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199902211232.XAA05724@godzilla.zeta.org.au>, Bruce Evans writes: >>Index: nfsstat.c >>=================================================================== >>RCS file: /home/ncvs/src/usr.bin/nfsstat/nfsstat.c,v >>retrieving revision 1.12 >>diff -u -r1.12 nfsstat.c >>--- nfsstat.c 1998/10/25 10:59:44 1.12 >>+++ nfsstat.c 1999/02/21 11:47:08 >>@@ -162,16 +162,9 @@ >> 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"); >> } >> } > >The old interface is the standard one (although the above code shows how >inconvenient it is). mountd uses it too. There is nothing "less standard" about sysctlbyname to my knowledge... -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message