[PATCH 02/13] Update PIDFD_* constants for Linux 6.17

Yury Khrustalev yury.khrustalev@arm.com
Fri Nov 7 09:56:43 GMT 2025


Hi,

On Thu, Nov 06, 2025 at 04:30:15PM +0100, Adhemerval Zanella Netto wrote:
> 
> On 06/11/25 15:59, Yury Khrustalev wrote:
> > On Fri, Oct 03, 2025 at 04:38:53PM -0300, Adhemerval Zanella wrote:
> >> The pidfd interface was extended with:
> >>
> >> ...
> > 
> > The misc/tst-pidfd_getinfo test fails with
> > 
> >   error: ../sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c:52: ioctl (PIDFD_GET_INFO) failed: Invalid argument
> > 
> > on aarch64 with kernel 6.12 and passes on a system with kernel 6.17 and 6.18.
> 
> I had the impression ENOTTY was the error code in this case, on 6.1.0:
> 
> $ strace -f misc/tst-pidfd_getinfo --direct
> [...]
> ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xff, 0xb, 0x48), 0x7ffe475d4670) = -1 ENOTTY (Inappropriate ioctl for device)
> [...]
> 
> If EINVAL is also a possible error we might need to also handle it.

On system with 6.12 I get:

  $ strace -e trace=ioctl -ff ./misc/tst-pidfd_getinfo 
  strace: Process 4177312 attached
  [pid 4177312] ioctl(3, _IOC(_IOC_READ|_IOC_WRITE, 0xff, 0xb, 0x48), 0xffffdda3a3a8) = -1 EINVAL (Invalid argument)
  error: ../sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c:52: ioctl (PIDFD_GET_INFO) failed: Invalid argument
  [pid 4177312] +++ exited with 1 +++
  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=4177312, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
  error: 1 test failures
  +++ exited with 1 +++

And on system with 6.17 I get:

  $ strace -e trace=ioctl -ff ./misc/tst-pidfd_getinfo
  strace: Process 5279 attached
  [pid  5279] ioctl(3, PIDFD_GET_INFO, 0xfffffffff308) = 0
  [pid  5279] +++ exited with 0 +++
  --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=5279, si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
  +++ exited with 0 +++

So, I think that the test should expect EINVAL for an unsupported flag,
in which case the test should be UNSUPPORTED.

It looks like man page for ioctl() stays that if op is not valid, EINVAL
would be returned errno:

  EINVAL op or argp is not valid.

And ENOTTY would be returned for an incorrect operation but only if
op was valid.

Thanks,
Yury



More information about the Libc-alpha mailing list