[LTP] [PATCH v4] syscalls/pidfd_open01.c: Add check for close-on-exec flag

Xiao Yang ice_yangxiao@163.com
Mon Jul 20 13:24:54 CEST 2020


Hi Petr, Viresh

Thanks a lot for your review, pushed. :-)

Thanks,

Xiao Yang

On 7/20/20 4:53 PM, Viresh Kumar wrote:
> On 20-07-20, 13:27, Xiao Yang wrote:
>> pidfd_open(2) will set close-on-exec flag on the file descriptor as
>> it manpage states, so check close-on-exec flag by fcntl(2).
>>
>> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
>> ---
>>
>> 1) We don't care if the test uses the TEST() macro so just keep it.
>> 2) Use bare fcntl() instead of SAFE_FCNTL() so that file descriptor
>>     can be closed when fcntl(F_GETFD) fails.
>>
>>   .../kernel/syscalls/pidfd_open/pidfd_open01.c  | 18 ++++++++++++++++--
>>   1 file changed, 16 insertions(+), 2 deletions(-)
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>



More information about the ltp mailing list