From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id C5A6B385624E for ; Mon, 27 Jun 2022 16:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C5A6B385624E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 72E7430005B6; Mon, 27 Jun 2022 18:36:43 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id A4EFB4000C41; Mon, 27 Jun 2022 18:36:42 +0200 (CEST) Message-ID: <335a602b41371a8c6f60625785c4d05c06c34c3d.camel@klomp.org> Subject: Re: [PATCH 3/4] tst-pidfd.c: Test is UNSUPPORTED without PTRACE_MODE_ATTACH_REALCREDS From: Mark Wielaard To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Date: Mon, 27 Jun 2022 18:36:42 +0200 In-Reply-To: References: <20220626205915.33201-1-mark@klomp.org> <20220626205915.33201-4-mark@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 16:36:46 -0000 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. >=20 > > --- 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 =3D pidfd_getfd (0, 0, 1); > > TEST_VERIFY_EXIT (r =3D=3D -1); > > - if (errno =3D=3D ENOSYS) > > - FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd, skipping= test"); > > + if (errno =3D=3D ENOSYS || errno =3D=3D EPERM) > > + FAIL_UNSUPPORTED ("kernel does not support pidfd_getfd," > > + " or we don't have PTRACE_MODE_ATTACH_REALCREDS" > > + " permissions, skipping test"); >=20 > 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