From bc5cb1e6aaa5f50f7ec508c1f0c1d8a539da0fcd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 6 Dec 2004 22:28:45 +0000 Subject: 2004-12-06 Roland McGrath * 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. --- rt/tst-timer5.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 rt/tst-timer5.c (limited to 'rt/tst-timer5.c') 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 +#include + +#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 -- cgit 1.4.1