summaryrefslogtreecommitdiff
path: root/core/src/xmake/os
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-24 22:57:21 +0800
committerruki <[email protected]>2022-10-24 22:57:21 +0800
commit7cf5b563927bc79748969d26e84d16884bbe4d73 (patch)
treeafa2eef440fb4244c00bd6e9a95c0fce4034208b /core/src/xmake/os
parentd8be2a1ca7bbc360a808eb921607fad74095f3cf (diff)
support openbsd
Diffstat (limited to 'core/src/xmake/os')
-rw-r--r--core/src/xmake/os/cpuinfo.c2
-rw-r--r--core/src/xmake/os/meminfo.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/src/xmake/os/cpuinfo.c b/core/src/xmake/os/cpuinfo.c
index 2cbb931ce..1e7753940 100644
--- a/core/src/xmake/os/cpuinfo.c
+++ b/core/src/xmake/os/cpuinfo.c
@@ -185,7 +185,7 @@ static tb_float_t xm_os_cpuinfo_usagerate()
}
}
return usagerate;
-#elif defined(TB_CONFIG_OS_BSD)
+#elif defined(TB_CONFIG_OS_BSD) && !defined(__OpenBSD__)
# define CP_USER 0
# define CP_NICE 1
# define CP_SYS 2
diff --git a/core/src/xmake/os/meminfo.c b/core/src/xmake/os/meminfo.c
index cd9ace234..b3bb435cd 100644
--- a/core/src/xmake/os/meminfo.c
+++ b/core/src/xmake/os/meminfo.c
@@ -135,7 +135,7 @@ static tb_bool_t xm_os_meminfo_stats(tb_int_t* ptotalsize, tb_int_t* pavailsize)
*pavailsize = (tb_int_t)(statex.ullAvailPhys / (1024 * 1024));
return tb_true;
}
-#elif defined(TB_CONFIG_OS_BSD)
+#elif defined(TB_CONFIG_OS_BSD) && !defined(__OpenBSD__)
unsigned long totalsize;
size_t size = sizeof(totalsize);
if (sysctlbyname("hw.physmem", &totalsize, &size, tb_null, 0) != 0)