[LTP] [PATCH] getitimer01.c: convert to new LTP API
Li Wang
liwang@redhat.com
Sun Oct 9 08:23:07 CEST 2022
On Thu, Jul 21, 2022 at 3:07 PM Li Wang <liwang@redhat.com> wrote:
> Hi Avinesh,
>
> Avinesh Kumar <akumar@suse.de> wrote:
>
>
>> + for (i = 0; i < 3; i++) {
>> + TST_EXP_PASS(getitimer(itimer_name[i], &value));
>> + TST_EXP_EQ_LI(value.it_value.tv_sec, 0);
>> + TST_EXP_EQ_LI(value.it_value.tv_usec, 0);
>>
>
> This is just to verify getittimer() works well when there is none
> of a specific interval timer being set.
>
> Maybe we can add some more tests to check if it fully implements
> the documented behavior? Or, at least confirming it gets expected
> signals for different types of timers-specified is also necessary.
>
After looking into this syscall specifically, those below 'which' types
are more useful to setitimer() [1]. So we could achieve more tests there but
not for getitimer().
I made some improvements and pushed this patch. Thanks!
[1]
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/setitimer/setitimer01.c
>
> ITIMER_REAL: At each expiration, a SIGALRM signal is generated.
> ITIMER_VIRTUAL : At each expiration, a SIGVTALRM signal is generated.
> ITIMER_PROF: At each expiration, a SIGPROF signal is generated.
>
> see: https://man7.org/linux/man-pages/man2/setitimer.2.html
>
> --
> Regards,
> Li Wang
>
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20221009/082efa9c/attachment.htm>
More information about the ltp
mailing list