From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] Correctly check if PIDFD_INFO_EXIT is available
Date: Wed, 30 Jul 2025 18:36:54 +0200 [thread overview]
Message-ID: <20250730163654.GA673913@pevik> (raw)
In-Reply-To: <20250730-ioctl_pidfd_supported-v4-1-db7bd905a1d6@suse.com>
Hi Andrea, all,
> When systems are not having the PIDFD_INFO_EXIT implementation,
> ioctl_pidfd testing suite might fail with:
> ioctl_pidfd.h:32: TBROK: ioctl(...) failed: ENOTTY (25)
> Fix the ioctl_pidfd_info_exit_supported() behavior, considering ENOTTY,
> EINVAL and ESRCH errors like a sign for not having PIDFD_INFO_EXIT
> implemented in the system.
Thanks for doing the investigation and fixing this!
...
> - SAFE_IOCTL(pidfd, PIDFD_GET_INFO, &info);
> - SAFE_CLOSE(pidfd);
> + ret = ioctl(pidfd, PIDFD_GET_INFO, &info);
> + if (ret == -1) {
> + /* - ENOTTY: old kernels not implementing fs/pidfs.c:pidfd_ioctl
> + * - EINVAL: until v6.13 kernel
> + * - ESRCH: all kernels between v6.13 and v6.15
> + */
> + if (errno != ENOTTY &&
> + errno != EINVAL &&
> + errno != ESRCH)
> + tst_brk(TBROK | TERRNO, "ioctl error");
> + } else {
> + if (info.mask & PIDFD_INFO_EXIT)
nit: this could have been:
} else if (info.mask & PIDFD_INFO_EXIT) {
Kind regards,
Petr
> + supported = 1;
> + }
> - if (info.mask & PIDFD_INFO_EXIT)
> - ret = 1;
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2025-07-30 16:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 12:20 [LTP] [PATCH v4] Correctly check if PIDFD_INFO_EXIT is available Andrea Cervesato
2025-07-30 14:28 ` Cyril Hrubis
2025-07-30 14:57 ` Andrea Cervesato via ltp
2025-07-30 16:36 ` Petr Vorel [this message]
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=20250730163654.GA673913@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@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