diff options
author | gj <gj@FreeBSD.org> | 1999-03-04 05:55:24 +0800 |
---|---|---|
committer | gj <gj@FreeBSD.org> | 1999-03-04 05:55:24 +0800 |
commit | c792f38423fc71c24d7f468a25f364c46bbe065f (patch) | |
tree | aecfff7be85b1f636ff701d80e7bce710ff2ad8f /sysutils | |
parent | 6f9745df8504b45aa79feb44082417c13e897a34 (diff) | |
download | freebsd-ports-gnome-c792f38423fc71c24d7f468a25f364c46bbe065f.tar.gz freebsd-ports-gnome-c792f38423fc71c24d7f468a25f364c46bbe065f.tar.zst freebsd-ports-gnome-c792f38423fc71c24d7f468a25f364c46bbe065f.zip |
Change the get_nfsstat routine to use sysctlbyname for -current, i.e.
__FreeBSD_version >= 400001. Thanks to Doug Rabson for the idea.
Reviewed by: Lars Koeller, the maintainer
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/xperfmon3/files/freebsd_system.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sysutils/xperfmon3/files/freebsd_system.c b/sysutils/xperfmon3/files/freebsd_system.c index 2e28cbfd3256..aca90959982a 100644 --- a/sysutils/xperfmon3/files/freebsd_system.c +++ b/sysutils/xperfmon3/files/freebsd_system.c @@ -5,7 +5,7 @@ * * Work has started on 7th Sep 1998 on Northsea island Föhr. * - * $Id: freebsd_system.c,v 3.4 1998/11/15 16:50:04 lkoeller Exp lkoeller $ + * $Id: freebsd_system.c,v 1.7 1999/02/04 05:10:53 gj Exp $ */ /* @@ -105,7 +105,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: freebsd_system.c,v 3.4 1998/11/15 16:50:04 lkoeller Exp lkoeller $"; +static char rcsid[] = "$Id: freebsd_system.c,v 1.7 1999/02/04 05:10:53 gj Exp $"; #endif #include "fbsd_vers.h" @@ -507,6 +507,7 @@ get_interrupts(void) static void get_nfsstat(void) { +#if __FreeBSD_version < 400001 int name[3]; size_t size = sizeof(nfsstats); @@ -514,6 +515,10 @@ get_nfsstat(void) name[1] = vfc.vfc_typenum; name[2] = NFS_NFSSTATS; if (sysctl(name, 3, &nfsstats, &size, (void *)0, (size_t)0) < 0) { +#else + size_t size = sizeof(nfsstats); + if (sysctlbyname("vfs.nfs.nfsstats", &nfsstats, &size, (void *)0, (size_t)0) < 0) { +#endif fprintf(stderr, "xperfmon++: get_nfsstat(): Can?%t get NFS statistics with sysctl()\n"); return; } |