1 /* Test setting the monotonic clock. */
6 #if defined CLOCK_MONOTONIC && defined _POSIX_MONOTONIC_CLOCK
14 if (sysconf (_SC_MONOTONIC_CLOCK
) <= 0)
18 if (clock_gettime (CLOCK_MONOTONIC
, &ts
) != 0)
20 puts ("clock_gettime(CLOCK_MONOTONIC) failed");
24 /* Setting the monotonic clock must fail. */
25 if (clock_settime (CLOCK_MONOTONIC
, &ts
) != -1)
27 puts ("clock_settime(CLOCK_MONOTONIC) did not fail");
32 printf ("clock_settime(CLOCK_MONOTONIC) set errno to %d, expected %d\n",
38 # define TEST_FUNCTION do_test ()
41 # define TEST_FUNCTION 0
43 #include "../test-skeleton.c"