<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 21, 2022 at 3:07 PM Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-size:small">Hi Avinesh,</div><div style="font-size:small"><br></div><div style="font-size:small">Avinesh Kumar <<a href="mailto:akumar@suse.de" target="_blank">akumar@suse.de</a>> wrote:<br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr"> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ for (i = 0; i < 3; i++) {<br>
+ TST_EXP_PASS(getitimer(itimer_name[i], &value));<br>
+ TST_EXP_EQ_LI(value.it_value.tv_sec, 0);<br>
+ TST_EXP_EQ_LI(value.it_value.tv_usec, 0);<br></blockquote><div><br></div><div style="font-size:small">This is just to verify getittimer() works well when there is none</div><div style="font-size:small">of a specific interval timer being set. </div><div style="font-size:small"><br></div><div style="font-size:small">Maybe we can add some more tests to check if it fully implements</div><div style="font-size:small">the documented behavior? Or, at least confirming it gets expected</div><div style="font-size:small">signals for different types of timers-specified is also necessary.</div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">After looking into this syscall specifically, those below 'which' types</div><div class="gmail_default" style="font-size:small">are more useful to setitimer() [1]. So we could achieve more tests there but</div><div class="gmail_default" style="font-size:small">not for getitimer().</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I made some improvements and pushed this patch. Thanks!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[1] <a href="https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/setitimer/setitimer01.c">https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/setitimer/setitimer01.c</a></div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div style="font-size:small"><br></div><span class="gmail_default" style="font-size:small"> </span>ITIMER_REAL<span class="gmail_default" style="font-size:small">:</span> <span class="gmail_default" style="font-size:small"> </span><span class="gmail_default" style="font-size:small"></span> At each expiration, a SIGALRM signal is generated. </div><div class="gmail_quote"><span class="gmail_default" style="font-size:small"> </span>ITIMER_VIRTUAL<span class="gmail_default" style="font-size:small"> :</span> <span class="gmail_default" style="font-size:small"></span> At each expiration, a SIGVTALRM signal is generated. </div><div class="gmail_quote"><span class="gmail_default" style="font-size:small"> </span>ITIMER_PROF<span class="gmail_default" style="font-size:small">:</span> <span class="gmail_default" style="font-size:small"> </span><span class="gmail_default" style="font-size:small"> </span>At each expiration, a SIGPROF signal is generated.</div><div class="gmail_quote"><br><div style="font-size:small">see: <a href="https://man7.org/linux/man-pages/man2/setitimer.2.html" target="_blank">https://man7.org/linux/man-pages/man2/setitimer.2.html</a></div></div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>