[PATCH] linux: Handle EINVAL as unsupported on tst-pidfd_getinfo

Florian Weimer fweimer@redhat.com
Thu Nov 20 19:50:10 GMT 2025


* Adhemerval Zanella:

> Some kernels returns EINVAL for ioctl (PIDFD_GET_INFO) on pidfd
> descriptors.
>
> Checked on aarch64-linux-gnu with Linux 6.12.
> ---
>  sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c b/sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c
> index 948a7cdb6b..f4a77816b4 100644
> --- a/sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c
> +++ b/sysdeps/unix/sysv/linux/tst-pidfd_getinfo.c
> @@ -46,7 +46,7 @@ do_test (void)
>    };
>    if (ioctl (pidfd, PIDFD_GET_INFO, &info) != 0)
>      {
> -      if (errno == ENOTTY)
> +      if (errno == ENOTTY || errno == EINVAL)
>  	FAIL_UNSUPPORTED ("kernel does not support PIDFD_GET_INFO");
>        else
>  	FAIL_EXIT1 ("ioctl (PIDFD_GET_INFO) failed: %m");

Okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list