about summary refs log tree commit diff
path: root/rt/tst-timer5.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-12-06 22:28:45 +0000
committerRoland McGrath <roland@gnu.org>2004-12-06 22:28:45 +0000
commitbc5cb1e6aaa5f50f7ec508c1f0c1d8a539da0fcd (patch)
treeec842c8e567974c466da767e2daeff0b5331bf2f /rt/tst-timer5.c
parentd8f73de86a4073070f5b626dc66a330d1597df88 (diff)
downloadglibc-bc5cb1e6aaa5f50f7ec508c1f0c1d8a539da0fcd.tar.gz
glibc-bc5cb1e6aaa5f50f7ec508c1f0c1d8a539da0fcd.tar.xz
glibc-bc5cb1e6aaa5f50f7ec508c1f0c1d8a539da0fcd.zip
2004-12-06 Roland McGrath <roland@redhat.com>
	* rt/tst-timer4.c (TEST_CLOCK, TEST_CLOCK_NANOSLEEP): New macros.
	Use them throughout in place of CLOCK_REALTIME and nanosleep.
	(do_test) [TEST_CLOCK_MISSING]: Call this macro and if it returns
	non-null, punt the test with a message using the string returned.
	* rt/tst-timer5.c: New file.
	* rt/Makefile (tests): Add it.
Diffstat (limited to 'rt/tst-timer5.c')
-rw-r--r--rt/tst-timer5.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/rt/tst-timer5.c b/rt/tst-timer5.c
new file mode 100644
index 0000000000..2683021eda
--- /dev/null
+++ b/rt/tst-timer5.c
@@ -0,0 +1,14 @@
+/* Timer test using the monotonic clock.  */
+
+#include <time.h>
+#include <unistd.h>
+
+#if defined CLOCK_MONOTONIC && defined _POSIX_MONOTONIC_CLOCK
+# define TEST_CLOCK	CLOCK_MONOTONIC
+# define TEST_CLOCK_MISSING(clock) \
+  (sysconf (_SC_MONOTONIC_CLOCK) > 0 ? NULL : #clock)
+# include "tst-timer4.c"
+#else
+# define TEST_FUNCTION	0
+# include "../test-skeleton.c"
+#endif