simple clock_gettime test
authorSzabolcs Nagy <nsz@port70.net>
Thu, 26 Dec 2013 17:14:30 +0000 (17:14 +0000)
committerSzabolcs Nagy <nsz@port70.net>
Thu, 26 Dec 2013 17:14:30 +0000 (17:14 +0000)
src/functional/clock_gettime.c [new file with mode: 0644]

diff --git a/src/functional/clock_gettime.c b/src/functional/clock_gettime.c
new file mode 100644 (file)
index 0000000..7951b11
--- /dev/null
@@ -0,0 +1,14 @@
+#include <time.h>
+#include <errno.h>
+#include <string.h>
+#include "test.h"
+
+#define TEST(c, ...) \
+       ( (c) || (t_error(#c " failed: " __VA_ARGS__),0) )
+
+int main()
+{
+       struct timespec ts;
+       TEST(clock_gettime(CLOCK_REALTIME, &ts) == 0 && errno == 0, "%s\n", strerror(errno));
+       return t_status;
+}