bc5cb1e6aa
* 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.
15 lines
368 B
C
15 lines
368 B
C
/* 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
|