summaryrefslogtreecommitdiffstats
path: root/libc-bottom-half/headers/public/__header_time.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-bottom-half/headers/public/__header_time.h
parentInitial commit. (diff)
downloadwasi-libc-upstream/0.0_git20221206.8b7148f.tar.xz
wasi-libc-upstream/0.0_git20221206.8b7148f.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-bottom-half/headers/public/__header_time.h')
-rw-r--r--libc-bottom-half/headers/public/__header_time.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/libc-bottom-half/headers/public/__header_time.h b/libc-bottom-half/headers/public/__header_time.h
new file mode 100644
index 0000000..2a2ff91
--- /dev/null
+++ b/libc-bottom-half/headers/public/__header_time.h
@@ -0,0 +1,33 @@
+#ifndef __wasilibc___header_time_h
+#define __wasilibc___header_time_h
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <__typedef_time_t.h>
+#include <__struct_timespec.h>
+#include <__struct_tm.h>
+#include <__typedef_clockid_t.h>
+
+#include <wasi/api.h>
+
+#define TIMER_ABSTIME __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME
+
+extern const struct __clockid _CLOCK_MONOTONIC;
+#define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC)
+extern const struct __clockid _CLOCK_REALTIME;
+#define CLOCK_REALTIME (&_CLOCK_REALTIME)
+
+/*
+ * TIME_UTC is the only standardized time base value.
+ */
+#define TIME_UTC 1
+
+/*
+ * Note that XSI specifies CLOCKS_PER_SEC to be 1000000, rather than
+ * 1000000000; the clock API is providing more precision than XSI specifies.
+ */
+#define CLOCKS_PER_SEC ((clock_t)1000000000)
+
+#endif