[LTP] [PATCH 5/5] syscalls/pidfd_getfd02: add basic error test

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Tue Feb 22 03:49:39 CET 2022


Hi Petr
> Hi Xu,
>
> ...
>>>> +	TST_EXP_FD_SILENT(pidfd_open(getpid(), 0), "pidfd_open");
>>> If you wait for Cyril's patch adding auto stringification
>>> https://lore.kernel.org/ltp/20220217142730.19726-1-chrubis@suse.cz/
>
>>> you can use just:
>>> TST_EXP_FD_SILENT(pidfd_open(getpid(), 0));
>
>>> and get more info.
>> I will look Cyril's patch and wait.
>
> FYI Cyril is not planning to merge that patch, replaced by
> https://lore.kernel.org/ltp/20220218103413.18540-1-chrubis@suse.cz/
>
> But I'd still drop "pidfd_open", because
> pidfd_getfd02.c:55: TFAIL: pidfd_open(getpid(), -9) failed: EINVAL (22)
> is better than:
> pidfd_getfd02.c:55: TFAIL: pidfd_open failed: EINVAL (22)
>
> But as fanotify21.c also needs SAFE_PIDFD_OPEN() (and more tests will come in
> the future I'd vote for adding SAFE_PIDFD_OPEN() as you suggested.
I will add SAFE_PIDFD_OPEN into lapi/pidfd_open.h. But it seems kernel 
doesn't have pidfd_getfd.h/pidfd_send_signal.h/pidfd_open.h, I think we 
can merge them into lapi/pidfd.h. So in the future, we can introduce 
other pidfd macro and case wants to use these pidfd macro they just only 
include one header(lapi/pidfd.h). What do you think about this?

Best Regards
Yang Xu
>
> Kind regards,
> Petr


More information about the ltp mailing list