Files
ports/polish/napi/files/patch-libs_libnapi__wrappers.sh
T
2026-10-04 04:07:15 +00:00

25 lines
638 B
Bash

--- libs/libnapi_wrappers.sh.orig 2020-04-24 07:38:48 UTC
+++ libs/libnapi_wrappers.sh
@@ -129,13 +129,20 @@ wrappers_isSystemDarwin() {
}
#
+# @brief returns true if system is FreeBSD
+#
+wrappers_isSystemFreeBSD() {
+ [ "$(wrappers_getSystem_SO)" = "freebsd" ]
+}
+
+#
# @brief determines number of available cpu's in the system
#
# @param system type (linux|darwin)
#
wrappers_getCores_SO() {
local os="${1:-linux}"
- if wrappers_isSystemDarwin; then
+ if wrappers_isSystemDarwin || wrappers_isSystemFreeBSD; then
sysctl hw.ncpu | cut -d ' ' -f 2
else
grep -i processor /proc/cpuinfo | wc -l