HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/ports/science/lm/files/patch-src_c_lm_main_Main.cpp
--- src/c/lm/main/Main.cpp.orig	2018-09-09 19:24:07 UTC
+++ src/c/lm/main/Main.cpp
@@ -49,6 +49,9 @@
 #include <sys/stat.h>
 #if defined(MACOSX)
 #include <sys/sysctl.h>
+#elif defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
 #elif defined(LINUX)
 #include <sys/sysinfo.h>
 #endif
@@ -110,6 +113,11 @@ int getPhysicalCpuCores()
     size_t  physicalCpuCoresSize=sizeof(physicalCpuCores);
     sysctlbyname("hw.activecpu",&physicalCpuCores,&physicalCpuCoresSize,NULL,0);
     return physicalCpuCores;
+    #elif defined(__FreeBSD__)
+    int	np = 0;
+    size_t	len = sizeof(np);
+    sysctlbyname("hw.ncpu",&np,&len,NULL,0);
+    return np;
     #elif defined(LINUX)
 	#ifdef ARM
 	return get_nprocs_conf();