]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/cloudlibc/src/libc/time/clock.c
Wasi snapshot preview1 (#140)
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / time / clock.c
index 47f15e50c975be3422add361aaadd9c7a7e80fc2..d0748f33c4f91546bbc4073f9cb3746702a07106 100644 (file)
@@ -5,7 +5,7 @@
 #include <common/time.h>
 
 #include <assert.h>
-#include <wasi/core.h>
+#include <wasi/api.h>
 #include <time.h>
 
 static_assert(CLOCKS_PER_SEC == NSEC_PER_SEC,
@@ -13,6 +13,10 @@ static_assert(CLOCKS_PER_SEC == NSEC_PER_SEC,
 
 clock_t clock(void) {
   __wasi_timestamp_t ts = 0;
+#ifdef __wasilibc_unmodified_upstream // generated constant names
   (void)__wasi_clock_time_get(__WASI_CLOCK_PROCESS_CPUTIME_ID, 0, &ts);
+#else
+  (void)__wasi_clock_time_get(__WASI_CLOCKID_PROCESS_CPUTIME_ID, 0, &ts);
+#endif
   return ts;
 }