From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <akumar@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] ioctl_pidfd05: Check if PIDFD_INFO_EXIT is available
Date: Wed, 17 Sep 2025 19:46:00 +0200 [thread overview]
Message-ID: <20250917174600.GA354055@pevik> (raw)
In-Reply-To: <20250917165403.6038-1-akumar@suse.de>
Hi Avinesh,
> This test also needs this check as it might fail with
> ioctl_pidfd05.c:45: TFAIL: ioctl(pidfd, PIDFD_GET_INFO, NULL) expected EINVAL: ENOTTY (25)
> ioctl_pidfd05.c:46: TFAIL: ioctl(pidfd, PIDFD_GET_INFO_SHORT, info_invalid) expected EINVAL: ENOTTY (25)
> when system does not have PIDFD_INFO_EXIT implementation.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Thanks for the fix!. As a quick fix this would work, because
ioctl_pidfd_info_exit_supported() is using ioctl(fd, PIDFD_GET_INFO, ...).
But because PIDFD_GET_INFO was added in 6.12:
cdda1f26e74b ("pidfd: add ioctl to retrieve pid info") # v6.12-rc3
and PIDFD_INFO_EXIT in v6.14:
7477d7dce48a ("pidfs: allow to retrieve exit information") # v6.14-rc1
it'd make sense to create ioctl_pidfd_get_info_supported() which would
be also used by ioctl_pidfd_info_exit_supported().
Why? There is 6.12 LTSS kernel branch which will get TCONF instead of being
tested.
It could be done ioctl_pidfd_get_info_supported() could return int64_t mask
(__u64 mask struct pidfd_info member if supported or -1 if ioctl() returned -1.
ioctl_pidfd_info_exit_supported() would just evaluate that. Other option is just
code duplicity.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-09-17 17:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 16:54 [LTP] [PATCH] ioctl_pidfd05: Check if PIDFD_INFO_EXIT is available Avinesh Kumar
2025-09-17 17:46 ` Petr Vorel [this message]
2025-09-18 13:31 ` Cyril Hrubis
2025-09-22 20:44 ` Avinesh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250917174600.GA354055@pevik \
--to=pvorel@suse.cz \
--cc=akumar@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox