From 2fe83e29cd736cc2ee71bc3fa959886465110fca Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 27 Apr 2022 15:24:02 +0900 Subject: [PATCH] sandboxed-system-primitives: make CPT/TCT clock ids optional (#1126) NuttX doesn't have them. --- .../libc-wasi/sandboxed-system-primitives/src/posix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c index 46d567e57..e55d63013 100644 --- a/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c +++ b/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c @@ -181,15 +181,19 @@ convert_clockid(__wasi_clockid_t in, clockid_t *out) case __WASI_CLOCK_MONOTONIC: *out = CLOCK_MONOTONIC; return true; +#if defined(CLOCK_PROCESS_CPUTIME_ID) case __WASI_CLOCK_PROCESS_CPUTIME_ID: *out = CLOCK_PROCESS_CPUTIME_ID; return true; +#endif case __WASI_CLOCK_REALTIME: *out = CLOCK_REALTIME; return true; +#if defined(CLOCK_THREAD_CPUTIME_ID) case __WASI_CLOCK_THREAD_CPUTIME_ID: *out = CLOCK_THREAD_CPUTIME_ID; return true; +#endif default: return false; }