ports/emulators/open-vm-tools/files/patch-cpus
2008-03-28 13:30:31 +00:00

30 lines
600 B
Text

--- lib/user/hostinfoPosix.c.orig 2008-03-19 08:49:50.000000000 +0100
+++ lib/user/hostinfoPosix.c 2008-03-27 17:40:38.000000000 +0100
@@ -68,6 +68,11 @@
#endif
#endif
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#endif
+
#include "vmware.h"
#include "hostType.h"
#include "hostinfo.h"
@@ -674,6 +679,15 @@
}
return out;
+#elseif (defined(__FreeBSD__)
+ uint32 out;
+ size_t outSize = sizeof out;
+
+ if (sysctlbyname("kern.smp.cpus", &out, &outSize, NULL, 0) == -1) {
+ return -1;
+ }
+
+ return out;
#else
static int count = 0;