[LTP] [PATCH v3] Correctly check setitimer params in setitimer01

Li Wang liwang@redhat.com
Fri Nov 11 10:41:29 CET 2022


Andrea Cervesato via ltp <ltp@lists.linux.it> wrote:


>  static void setup(void)
>  {
> ...
> +       struct timespec time_res;
> +
> +       /*
> +        * We use CLOCK_MONOTONIC_COARSE resolution for all timers, since
> +        * we are sure its value is bigger than CLOCK_MONOTONIC and we can
> use
> +        * it for both realtime and virtual/prof timers resolutions.
> +        */
> +       SAFE_CLOCK_GETRES(CLOCK_MONOTONIC_COARSE, &time_res);
> +
> +       time_step = time_res.tv_nsec / 1000;
> +       if (time_step <= 0)
> +               time_step = 1000;
> +
> +       time_count = 3 * time_step;
> +
> +       tst_res(TINFO, "clock resolution: %luns, "
>


I would use "low-resolution" for this output, but
someone merge patch can help modify it.

Reviewed-by: Li Wang <liwang@redhat.com>


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20221111/1f467ffa/attachment.htm>


More information about the ltp mailing list