Skip to content

Commit 9658fdd

Browse files
committed
fix(zephyr): Add os_nanosleep impleemntation for POSIX platform
1 parent 3094ffb commit 9658fdd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/shared/platform/common/posix/posix_sleep.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <time.h>
77

88
#include "platform_api_extension.h"
9+
#include "libc_errno.h"
910

1011
int
1112
os_usleep(uint32 usec)
@@ -18,3 +19,13 @@ os_usleep(uint32 usec)
1819
ret = nanosleep(&ts, NULL);
1920
return ret == 0 ? 0 : -1;
2021
}
22+
23+
__wasi_errno_t
24+
os_nanosleep(os_timespec *req, os_timespec *rem)
25+
{
26+
int ret;
27+
28+
ret = nanosleep(req, rem);
29+
30+
return convert_errno(ret);
31+
}

0 commit comments

Comments
 (0)