]> git.proxmox.com Git - wasi-libc.git/blobdiff - libc-bottom-half/cloudlibc/src/libc/sys/time/gettimeofday.c
Wasi snapshot preview1 (#140)
[wasi-libc.git] / libc-bottom-half / cloudlibc / src / libc / sys / time / gettimeofday.c
index 15a0d56415ef01a88cbe01723952f12bfe22689b..9d33386fb68499c5590d6e4f69d7057f5fe1e8ff 100644 (file)
@@ -6,7 +6,7 @@
 
 #include <sys/time.h>
 
-#include <wasi/core.h>
+#include <wasi/api.h>
 
 #ifdef __wasilibc_unmodified_upstream
 int gettimeofday(struct timeval *restrict tp, ...) {
@@ -14,7 +14,11 @@ int gettimeofday(struct timeval *restrict tp, ...) {
 int gettimeofday(struct timeval *restrict tp, void *tz) {
 #endif
   __wasi_timestamp_t ts = 0;
+#ifdef __wasilibc_unmodified_upstream // generated constant names
   (void)__wasi_clock_time_get(__WASI_CLOCK_REALTIME, 1000, &ts);
+#else
+  (void)__wasi_clock_time_get(__WASI_CLOCKID_REALTIME, 1000, &ts);
+#endif
   *tp = timestamp_to_timeval(ts);
   return 0;
 }