[LTP] [PATCH] syscalls: kill: Remove kill07

Ricardo B. Marlière rbm@suse.com
Mon Jun 16 16:09:27 CEST 2025


On Mon Jun 16, 2025 at 11:08 AM -03, Li Wang wrote:
> On Mon, Jun 16, 2025 at 7:02 PM Ricardo B. Marlière <rbm@suse.com> wrote:
>
>> On Wed Jun 11, 2025 at 10:52 PM -03, Li Wang wrote:
>> > Ricardo B. Marlière via ltp <ltp@lists.linux.it> wrote:
>> >
>> > From: Ricardo B. Marlière <rbm@suse.com>
>> >>
>> >> The test case description reads:
>> >>
>> >> "Test case to check that SIGKILL can not be caught."
>> >>
>> >> It makes use of sigaction() to set up a handler for SIGKILL, but
>> >> according to its manual page:
>> >>
>> >> "EINVAL An invalid signal was specified.  This will also be generated
>> if an
>> >> attempt is made to change the action for SIGKILL or SIGSTOP, which
>> cannot
>> >> be caught or ignored."
>> >>
>> >
>> > Or could we refactor kill07 to validate the EINVAL when changing action
>> on
>> > SIGKILL/SIGSTOP?
>>
>> But then we would be testing sigaction(). Could you please elaborate?
>>
>
> You're right, if we test sigaction(), then the code should be put into
> kernel/syscalls/sigaction/sigaction03.c.
>
> Maybe we can try:

Sure! But in any case kill07 should still be removed IMHO.

>
> static void run(void)
> {
>     struct sigaction act = {
>         .sa_handler = SIG_IGN,
>     };
>
>     int ret;
>
>     ret = sigaction(SIGKILL, &act, NULL);
>     if (ret == -1 && errno == EINVAL) {
>         tst_res(TPASS, "sigaction(SIGKILL) failed as expected with EINVAL");
>     } else {
>         tst_res(TFAIL, ...);
>     }
>
>     ret = sigaction(SIGSTOP, &act, NULL);
>     If (ret == -1 && errno == EINVAL) {
>         tst_res(TPASS, "sigaction(SIGSTOP) failed as expected with EINVAL");
>     } else {
>         tst_res(TFAIL, ...);
>     }
> }



More information about the ltp mailing list