summaryrefslogtreecommitdiffstats
path: root/config.tests/unix/clock-monotonic/clock-monotonic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'config.tests/unix/clock-monotonic/clock-monotonic.cpp')
-rw-r--r--config.tests/unix/clock-monotonic/clock-monotonic.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/config.tests/unix/clock-monotonic/clock-monotonic.cpp b/config.tests/unix/clock-monotonic/clock-monotonic.cpp
new file mode 100644
index 0000000..df99963
--- /dev/null
+++ b/config.tests/unix/clock-monotonic/clock-monotonic.cpp
@@ -0,0 +1,16 @@
+#include <unistd.h>
+#include <time.h>
+
+int main(int, char **)
+{
+#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
+ timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+#else
+# error "Feature _POSIX_MONOTONIC_CLOCK not available"
+ // MIPSpro doesn't understand #error, so force a compiler error
+ force_compiler_error = true;
+#endif
+ return 0;
+}
+