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