aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xperfmon3
diff options
context:
space:
mode:
authorGary Jennejohn <gj@FreeBSD.org>1999-03-03 21:55:24 +0000
committerGary Jennejohn <gj@FreeBSD.org>1999-03-03 21:55:24 +0000
commitc81c40c7b41bea59f41240c6b7b916586ddd9a26 (patch)
tree9f6f3ed89ec158c1566ff769bff7009416714e1b /sysutils/xperfmon3
parent57cf8ac0e734b6edd15e9dfd2c7a8933933d3f2e (diff)
downloadports-c81c40c7b41bea59f41240c6b7b916586ddd9a26.tar.gz
ports-c81c40c7b41bea59f41240c6b7b916586ddd9a26.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
Notes
Notes: svn path=/head/; revision=16992
Diffstat (limited to 'sysutils/xperfmon3')
-rw-r--r--sysutils/xperfmon3/files/freebsd_system.c9
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;
}