[LTP] [PATCH] nanosleep: Use CLOCK_MONOTONIC for elapsed time measurement
Cyril Hrubis
chrubis@suse.cz
Tue Mar 31 14:23:21 CEST 2026
Hi!
> > #if _POSIX_MONOTONIC_CLOCK
> > # define TEST_CLOCK CLOCK_MONOTONIC
> > #else
> > # define TEST_CLOCK CLOCK_REALTIME
> > #endif
>
> good point. If it was a non-posix project it was called non-openposix :-)
>
> Do you think that check is enough in this case? Or we should just mark
> this test (if we really want to keep it 100% posix) as XFAIL ? I really
> didn't see any option but introducing CLOCK_MONOTONIC checks.
Maybe we can can print a hint that we are falling back to CLOCK_REALTIME
in case that CLOCK_MONOTNIC is not there and proceed with the test.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list