diff options
author | ehaupt <ehaupt@FreeBSD.org> | 2005-10-07 01:59:31 +0800 |
---|---|---|
committer | ehaupt <ehaupt@FreeBSD.org> | 2005-10-07 01:59:31 +0800 |
commit | 909301d20b53090a88d7c91aa673a053386b5a8c (patch) | |
tree | 7019b1fcb4bea04357030ac268e80109b6445c46 /sysutils/x86info/files | |
parent | d92c2c3651183ef31f66644cd09dd8a115dae809 (diff) | |
download | freebsd-ports-gnome-909301d20b53090a88d7c91aa673a053386b5a8c.tar.gz freebsd-ports-gnome-909301d20b53090a88d7c91aa673a053386b5a8c.tar.zst freebsd-ports-gnome-909301d20b53090a88d7c91aa673a053386b5a8c.zip |
Fix build on 4.x
PR: 86953
Reported by: Jukka Ukkonen <jau@iki.fi>
Submitted by: mnag
Approved by: novel (mentor)
Diffstat (limited to 'sysutils/x86info/files')
-rw-r--r-- | sysutils/x86info/files/patch-x86info.c | 35 |
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); |