aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorEmanuel Haupt <ehaupt@FreeBSD.org>2005-10-06 17:59:31 +0000
committerEmanuel Haupt <ehaupt@FreeBSD.org>2005-10-06 17:59:31 +0000
commit35ac9b9f021e38f22f7467ae1816080f3e43e513 (patch)
treec66753dae5d2ba0cbd96c5b98104e53cd3ef9b23 /sysutils
parentdc0e868aa65610487f9b4472c26269d702b06e2b (diff)
downloadports-35ac9b9f021e38f22f7467ae1816080f3e43e513.tar.gz
ports-35ac9b9f021e38f22f7467ae1816080f3e43e513.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/x86info/files/patch-x86info.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/sysutils/x86info/files/patch-x86info.c b/sysutils/x86info/files/patch-x86info.c
new file mode 100644
index 000000000000..48cc9ea95154
--- /dev/null
+++ b/sysutils/x86info/files/patch-x86info.c
@@ -0,0 +1,35 @@
+--- x86info.c.orig Sat Sep 24 17:33:38 2005
++++ x86info.c Wed Oct 5 17:34:30 2005
+@@ -11,6 +11,10 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#if __FreeBSD__ < 500000
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
+
+ #include "x86info.h"
+
+@@ -175,6 +179,9 @@
+ {
+ unsigned int i;
+ struct cpudata *cpu, *head=NULL, *tmp;
++#if __FreeBSD__ < 500000
++ size_t nr = sizeof(nrCPUs);
++#endif
+
+ parse_command_line(argc, argv);
+ if (!silent) {
+@@ -194,7 +201,11 @@
+ if (need_root && !user_is_root)
+ printf ("Need to be root to use specified options.\n");
+
++#if __FreeBSD__ > 500000
+ nrCPUs = sysconf (_SC_NPROCESSORS_CONF);
++#else
++ sysctlbyname("hw.ncpu", &nrCPUs, &nr, NULL, 0);
++#endif
+
+ if (!silent) {
+ printf ("Found %u CPU", nrCPUs);