diff options
| author | ruki <[email protected]> | 2022-10-24 22:57:21 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-10-24 22:57:21 +0800 |
| commit | 7cf5b563927bc79748969d26e84d16884bbe4d73 (patch) | |
| tree | afa2eef440fb4244c00bd6e9a95c0fce4034208b /core/src | |
| parent | d8be2a1ca7bbc360a808eb921607fad74095f3cf (diff) | |
support openbsd
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/engine.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/os/cpuinfo.c | 2 | ||||
| -rw-r--r-- | core/src/xmake/os/meminfo.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c index 20b845ccb..4331fa715 100644 --- a/core/src/xmake/engine.c +++ b/core/src/xmake/engine.c @@ -52,7 +52,7 @@ */ #if defined(TB_CONFIG_OS_LINUX) # define XM_PROC_SELF_FILE "/proc/self/exe" -#elif defined(TB_CONFIG_OS_BSD) +#elif defined(TB_CONFIG_OS_BSD) && !defined(__OpenBSD__) # if defined(__FreeBSD__) # define XM_PROC_SELF_FILE "/proc/curproc/file" # elif defined(__NetBSD__) 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) |
