[PATCH 3/4] tst-pidfd.c: Test is UNSUPPORTED without PTRACE_MODE_ATTACH_REALCREDS

Mark Wielaard mark@klomp.org
Mon Jun 27 16:36:42 GMT 2022


Hi Adhemerval,

On Mon, 2022-06-27 at 11:23 -0300, Adhemerval Zanella wrote:
> I think it would be good print different errors for ENOSYS and EPERM.
> 
> > --- a/sysdeps/unix/sysv/linux/tst-pidfd.c
> > +++ b/sysdeps/unix/sysv/linux/tst-pidfd.c
> > @@ -95,8 +95,10 @@ do_test (void)
> >        kernel has pidfd support that we can test.  */
> >     int r = pidfd_getfd (0, 0, 1);
> >     TEST_VERIFY_EXIT (r == -1);
> > -    if (errno == ENOSYS)
> > -      FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd, skipping test");
> > +    if (errno == ENOSYS || errno == EPERM)
> > +      FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd,"
> > +			" or we don't have PTRACE_MODE_ATTACH_REALCREDS"
> > +			" permissions, skipping test");
> 
> Keep the ENOSYS error message and add EPERM.

I posted a v2 that does that:
https://sourceware.org/pipermail/libc-alpha/2022-June/140054.html

Cheers,

Mark


More information about the Libc-alpha mailing list