Message ID | 20200131170354.25539-1-alistair.francis@wdc.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 37825 invoked by alias); 31 Jan 2020 17:10:34 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 37816 invoked by uid 89); 31 Jan 2020 17:10:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:913, HContent-Transfer-Encoding:8bit X-HELO: esa6.hgst.iphmx.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1580490634; x=1612026634; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Xwvj54QOPPN05gvy6ODNYfoMpgatTrj/cRYDlUvTPt8=; b=N2BMPUIkPJ1Q1xCeQDLQkVoMBUpMJyOZagwqjey5DaNe8FiXTMOCFdge H1vvdd33dehn+X65z7SaNYkV6ate0IbNML/uXHwuRr5yt/PR3TnQmzll1 tIzbsbFpAU+F5QCYaA8oFlH8BFVwnyAUfFMPzYU+fw3rXv5gtJERJ72Om PCW6Blp7jH4EPBr7HkckJx3ziEmvT1BJEh30ZsYYm4ecYn6qZWMLkAs3S /Aa804Zu+RsnGU2DtGJk730LkHr+y/tlXtaxgOJf9YekYapADBTIUraN2 5de+8kw6WnC79avJ/TcDQkl/p7xQH4wRSKU8Ynrt51uDTFNihohRor+dl w==; IronPort-SDR: WzWYq0DafB7iom40tQWJlRyeUsd4wgQJkIZj2OTlYmDnIRdQ0iP/xX6YBK1kctqzsejWtPBib+ zcUB118mTb+IQGo58UiWjyyr03OWuKZ73zvPUvStUSTO/hsbKJT9mhChV6D6zmwJqGaBjVmi2j 6tOLXG4vPLr7rNwBKWfy2OHJ2B9zMuSkfkhCyvYcVfDEl+vKsT9dM0OemWk58vnDRvHCpp4zME XE2HNnTeW+V5fVlQbhunmWdndIdH9RRGmjJbnUOFaLleSzHuglf69zVPqaQjcnS20JCvEwaF2d Qok= IronPort-SDR: 4nFKW2QSBwxk+dZCbcXqE4jFRAYCNeZ4SUG1Ud1yslpVaWLqJBAsmjshsTwR+WhaB/Df4Cp5jx Rs/ng6Iduw/XlkVtvffHu0HZtBbaQaoquX/mvgseVX4b0Xb17dlciGbTXqr+fmktTtW0U2ovUg UaDkvhtD9jBfLRz8biDx+GNi7kZys0Gs0lqdoNDOl4sDG1cBVtyC9v+9gtbSYVHYKXQFlQiBEx C2LP/C9IGwSYzuA78T2DRjYOMFf/zQB9fx45FcupaU12h3MHsIn4S9R1goC3CLSexEu2Qd9UDp 4xSjViO+4fUyrXSppGmrF+ce IronPort-SDR: 6aSCp33oHRx7uBGX8V6vrRgaiUEyralYyMJKcukUtI/cchwdu2WywmsRoyvYesAOubbcaJsPZ8 Xz2F76VMhCj1hKteoOCn3uVY+kuQMFTHDfkwNiLv7727Jw7WGoSJ8fehZOVbThP7gy54ae2ODe uomoHp+5TmkUvQ4RTfZ/vwehO52TTbJ+AJCtTXkn9IyEIgiKbGlnfgKjHt6sriJd80jmPxGj7A rb6Mkmut4xdDDn+SKLa9sC4LUHpA6VddMd65jp6f8bPpaaLH8QXDo85zo7u+zfbUMdiSi7pTOE RZM= WDCIronportException: Internal From: Alistair Francis <alistair.francis@wdc.com> To: libc-alpha@sourceware.org Cc: alistair23@gmail.com, Alistair Francis <alistair.francis@wdc.com> Subject: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex Date: Fri, 31 Jan 2020 09:03:54 -0800 Message-Id: <20200131170354.25539-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Commit Message
Alistair Francis
Jan. 31, 2020, 5:03 p.m. UTC
We can't include sysdep.h in the test case (it introduces lots of strange failures) so __NR_futex isn't redifined to __NR_futex_time64 by 64-bit time_t 32-bit archs (y2038 safe). To allow the test to pass let's just do the __NR_futex_time64 syscall if we don't have __NR_futex defined. --- sysdeps/unix/sysv/linux/tst-clone3.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
On Fri, Jan 31, 2020 at 6:10 PM Alistair Francis <alistair.francis@wdc.com> wrote: > > We can't include sysdep.h in the test case (it introduces lots of > strange failures) so __NR_futex isn't redifined to __NR_futex_time64 by > 64-bit time_t 32-bit archs (y2038 safe). > > To allow the test to pass let's just do the __NR_futex_time64 syscall if > we don't have __NR_futex defined. > --- > sysdeps/unix/sysv/linux/tst-clone3.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c > index 400eb89a5b..613cb4a811 100644 > --- a/sysdeps/unix/sysv/linux/tst-clone3.c > +++ b/sysdeps/unix/sysv/linux/tst-clone3.c > @@ -56,7 +56,11 @@ f (void *a) > static inline int > futex_wait (int *futexp, int val) > { > +#ifdef __NR_futex > return syscall (__NR_futex, futexp, FUTEX_WAIT, val); > +#else > + return syscall (__NR_futex_time64, futexp, FUTEX_WAIT, val); > +#endif > } There are other references to __NR_futex and INTERNAL_SYSCALL (futex, ...) that likely suffer from the same problem. Would it make sense to address those all at once? Arnd
On Fri, Jan 31, 2020 at 1:47 PM Arnd Bergmann <arnd@arndb.de> wrote: > > On Fri, Jan 31, 2020 at 6:10 PM Alistair Francis > <alistair.francis@wdc.com> wrote: > > > > We can't include sysdep.h in the test case (it introduces lots of > > strange failures) so __NR_futex isn't redifined to __NR_futex_time64 by > > 64-bit time_t 32-bit archs (y2038 safe). > > > > To allow the test to pass let's just do the __NR_futex_time64 syscall if > > we don't have __NR_futex defined. > > --- > > sysdeps/unix/sysv/linux/tst-clone3.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c > > index 400eb89a5b..613cb4a811 100644 > > --- a/sysdeps/unix/sysv/linux/tst-clone3.c > > +++ b/sysdeps/unix/sysv/linux/tst-clone3.c > > @@ -56,7 +56,11 @@ f (void *a) > > static inline int > > futex_wait (int *futexp, int val) > > { > > +#ifdef __NR_futex > > return syscall (__NR_futex, futexp, FUTEX_WAIT, val); > > +#else > > + return syscall (__NR_futex_time64, futexp, FUTEX_WAIT, val); > > +#endif > > } > > There are other references to __NR_futex and INTERNAL_SYSCALL (futex, ...) > that likely suffer from the same problem. Would it make sense to address > those all at once? This is normally handled by something like this: # ifndef __NR_futex # define __NR_futex __NR_futex_time64 # endif in sysdep.h. This test is the only case I have seen where sysdep.h isn't included (and I couldn't easily include it) hence the manual fixup. Alistair > > Arnd
On Fri, Jan 31, 2020 at 9:10 AM Alistair Francis <alistair.francis@wdc.com> wrote: > > We can't include sysdep.h in the test case (it introduces lots of > strange failures) so __NR_futex isn't redifined to __NR_futex_time64 by > 64-bit time_t 32-bit archs (y2038 safe). > > To allow the test to pass let's just do the __NR_futex_time64 syscall if > we don't have __NR_futex defined. Ping! > --- > sysdeps/unix/sysv/linux/tst-clone3.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c > index 400eb89a5b..613cb4a811 100644 > --- a/sysdeps/unix/sysv/linux/tst-clone3.c > +++ b/sysdeps/unix/sysv/linux/tst-clone3.c > @@ -56,7 +56,11 @@ f (void *a) > static inline int > futex_wait (int *futexp, int val) > { > +#ifdef __NR_futex > return syscall (__NR_futex, futexp, FUTEX_WAIT, val); > +#else > + return syscall (__NR_futex_time64, futexp, FUTEX_WAIT, val); > +#endif > } > > static int > -- > 2.25.0 >
On 31/01/2020 14:03, Alistair Francis wrote: > We can't include sysdep.h in the test case (it introduces lots of > strange failures) so __NR_futex isn't redifined to __NR_futex_time64 by > 64-bit time_t 32-bit archs (y2038 safe). > > To allow the test to pass let's just do the __NR_futex_time64 syscall if > we don't have __NR_futex defined. LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > sysdeps/unix/sysv/linux/tst-clone3.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c > index 400eb89a5b..613cb4a811 100644 > --- a/sysdeps/unix/sysv/linux/tst-clone3.c > +++ b/sysdeps/unix/sysv/linux/tst-clone3.c > @@ -56,7 +56,11 @@ f (void *a) > static inline int > futex_wait (int *futexp, int val) > { > +#ifdef __NR_futex > return syscall (__NR_futex, futexp, FUTEX_WAIT, val); > +#else > + return syscall (__NR_futex_time64, futexp, FUTEX_WAIT, val); > +#endif > } > > static int >
diff --git a/sysdeps/unix/sysv/linux/tst-clone3.c b/sysdeps/unix/sysv/linux/tst-clone3.c index 400eb89a5b..613cb4a811 100644 --- a/sysdeps/unix/sysv/linux/tst-clone3.c +++ b/sysdeps/unix/sysv/linux/tst-clone3.c @@ -56,7 +56,11 @@ f (void *a) static inline int futex_wait (int *futexp, int val) { +#ifdef __NR_futex return syscall (__NR_futex, futexp, FUTEX_WAIT, val); +#else + return syscall (__NR_futex_time64, futexp, FUTEX_WAIT, val); +#endif } static int