From 45acd9fb9f7efa9fb3d57dc41833658f0a9bf499 Mon Sep 17 00:00:00 2001 From: Lucas Abad <149054121+lucasAbadFr@users.noreply.github.com> Date: Tue, 9 Sep 2025 11:16:08 +0200 Subject: [PATCH] fix(zephyr): Make the simple-file sample compile by commenting nanosleep as a temp solution --- .../libc-wasi/sandboxed-system-primitives/src/posix.c | 4 ++-- core/shared/platform/zephyr/platform_internal.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) 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 3d90811bc..d20537ad0 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 @@ -2135,7 +2135,7 @@ wasmtime_ssp_poll_oneoff(wasm_exec_env_t exec_env, struct fd_table *curfds, // nanosleep(). This is incorrect, but good enough for now. os_timespec ts; convert_timestamp(in[0].u.u.clock.timeout, &ts); - nanosleep(&ts, NULL); + // nanosleep(&ts, NULL); } break; case __WASI_CLOCK_REALTIME: @@ -2163,7 +2163,7 @@ wasmtime_ssp_poll_oneoff(wasm_exec_env_t exec_env, struct fd_table *curfds, // Relative sleeps can be done using nanosleep(). os_timespec ts; convert_timestamp(in[0].u.u.clock.timeout, &ts); - nanosleep(&ts, NULL); + // nanosleep(&ts, NULL); } break; default: diff --git a/core/shared/platform/zephyr/platform_internal.h b/core/shared/platform/zephyr/platform_internal.h index 7e59faa74..ae2014408 100644 --- a/core/shared/platform/zephyr/platform_internal.h +++ b/core/shared/platform/zephyr/platform_internal.h @@ -51,6 +51,7 @@ #include #include #include +#include #endif /* end of KERNEL_VERSION_NUMBER < 0x030200 */ #ifdef CONFIG_USERSPACE