From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 139293858D35 for ; Sat, 5 Aug 2023 15:53:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 139293858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Sam James Mime-Version: 1.0 (1.0) Subject: Re: [PATCH 2/2] sysdeps: tst-bz21269: handle ENOSYS & skip appropriately Date: Sat, 5 Aug 2023 16:53:41 +0100 Message-Id: <6A2766C1-5740-4EC8-93B8-E74EF6910486@gentoo.org> References: <6886809b-433f-bae7-22c8-81491ed46107@gmail.com> Cc: libc-alpha@sourceware.org, arsen@gentoo.org In-Reply-To: <6886809b-433f-bae7-22c8-81491ed46107@gmail.com> To: Gabriel Ravier X-Mailer: iPhone Mail (20G75) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 5 Aug 2023, at 16:41, Gabriel Ravier wrote: >=20 > =EF=BB=BFOn 8/5/23 02:00, Sam James via Libc-alpha wrote: >> SYS_modify_ldt requires CONFIG_MODIFY_LDT_SYSCALL to be set in the kernel= , which >> some distributions may disable for hardening. Check if that's the case (u= nset) >> and mark the test as UNSUPPORTED if so. >>=20 >> Signed-off-by: Sam James >> --- >> sysdeps/unix/sysv/linux/i386/tst-bz21269.c | 11 ++++++++++- >> 1 file changed, 10 insertions(+), 1 deletion(-) >>=20 >> diff --git a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c b/sysdeps/unix/sy= sv/linux/i386/tst-bz21269.c >> index f508ef8f16..345b4ebc45 100644 >> --- a/sysdeps/unix/sysv/linux/i386/tst-bz21269.c >> +++ b/sysdeps/unix/sysv/linux/i386/tst-bz21269.c >> @@ -52,7 +52,16 @@ xset_thread_area (struct user_desc *u_info) >> static void >> xmodify_ldt (int func, const void *ptr, unsigned long bytecount) >> { >> - TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, func, ptr, bytecount) =3D=3D= 0); >> + long ret =3D syscall (SYS_modify_ldt, func, ptr, bytecount); >> + >> + if (ret =3D=3D -1) >> + { >> + if (errno =3D=3D ENOSYS) >> + FAIL_UNSUPPORTED ("modify_ldt not supported"); >> + FAIL_EXIT1 ("semget failed (errno=3D%d)", errno); > ...How are semget and modify_ldt related here ? >> + } >> + Copy-paste error last night I didn't clean up ;) Thanks! >> + return 0; >> } >> static int >=20 >=20