[LTP] [PATCH v3 4/4] syscalls/clock_adjtime: create clock_adjtime syscall tests
Rafael David Tinoco
rafael.tinoco@linaro.org
Thu Mar 21 21:31:48 CET 2019
> +static void setup(void)
> +{
> + size_t i;
> + int rval;
> +
> + /* check if clock is TIME_OK and save original clock flags */
> +
> + rval = SAFE_CLOCK_ADJTIME(CLOCK_REALTIME, &saved);
> +
> + if (rval != TIME_OK)
> + tst_brk(TBROK | TTERRNO, "unsynced clock or on-going leap”);
I choose to break test if rval > 0 mainly because it could still have
on-going leap operations, since clock_adjtime() is async, and also
because doing the test with an unsynced clock seems weird.
Ran both or 10 seconds w/out any issue.
Same for clock_adtime02:
> +static void setup(void)
> +{
> + size_t i;
> + int rval;
> +
> + /* check if clock is TIME_OK and save original clock flags */
> +
> + rval = SAFE_CLOCK_ADJTIME(CLOCK_REALTIME, &saved);
> +
> + if (rval != TIME_OK)
> + tst_brk(TBROK | TTERRNO, "unsynced clock or on-going leap");
> +
More information about the ltp
mailing list