unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
@ 2019-11-12 17:36 Alistair Francis
  2019-12-03 18:56 ` Alistair Francis
  0 siblings, 1 reply; 9+ messages in thread
From: Alistair Francis @ 2019-11-12 17:36 UTC (permalink / raw)
  To: libc-alpha; +Cc: alistair23, Alistair Francis

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.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 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 76f8b08a692..c211445e77f 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.23.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2019-11-12 17:36 Alistair Francis
@ 2019-12-03 18:56 ` Alistair Francis
  2019-12-09 18:54   ` Alistair Francis
  0 siblings, 1 reply; 9+ messages in thread
From: Alistair Francis @ 2019-12-03 18:56 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library

On Tue, Nov 12, 2019 at 9:42 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!

Alistair

>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  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 76f8b08a692..c211445e77f 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.23.0
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2019-12-03 18:56 ` Alistair Francis
@ 2019-12-09 18:54   ` Alistair Francis
  2019-12-20  4:02     ` Alistair Francis
  0 siblings, 1 reply; 9+ messages in thread
From: Alistair Francis @ 2019-12-09 18:54 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library

On Tue, Dec 3, 2019 at 10:56 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Nov 12, 2019 at 9:42 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!

Ping^2

>
> Alistair
>
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> >  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 76f8b08a692..c211445e77f 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.23.0
> >

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2019-12-09 18:54   ` Alistair Francis
@ 2019-12-20  4:02     ` Alistair Francis
  0 siblings, 0 replies; 9+ messages in thread
From: Alistair Francis @ 2019-12-20  4:02 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library

On Mon, Dec 9, 2019 at 10:54 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Tue, Dec 3, 2019 at 10:56 AM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Tue, Nov 12, 2019 at 9:42 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!
>
> Ping^2

Ping^3

>
> >
> > Alistair
> >
> > >
> > > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > > ---
> > >  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 76f8b08a692..c211445e77f 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.23.0
> > >

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
@ 2020-01-31 17:03 Alistair Francis
  2020-01-31 21:47 ` Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alistair Francis @ 2020-01-31 17:03 UTC (permalink / raw)
  To: libc-alpha; +Cc: alistair23, Alistair Francis

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
 }
 
 static int
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2020-01-31 17:03 [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex Alistair Francis
@ 2020-01-31 21:47 ` Arnd Bergmann
  2020-01-31 23:46   ` Alistair Francis
  2020-02-14 16:40 ` Alistair Francis
  2020-02-14 17:55 ` Adhemerval Zanella
  2 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2020-01-31 21:47 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library, Alistair Francis

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2020-01-31 21:47 ` Arnd Bergmann
@ 2020-01-31 23:46   ` Alistair Francis
  0 siblings, 0 replies; 9+ messages in thread
From: Alistair Francis @ 2020-01-31 23:46 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Alistair Francis, GNU C Library

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2020-01-31 17:03 [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex Alistair Francis
  2020-01-31 21:47 ` Arnd Bergmann
@ 2020-02-14 16:40 ` Alistair Francis
  2020-02-14 17:55 ` Adhemerval Zanella
  2 siblings, 0 replies; 9+ messages in thread
From: Alistair Francis @ 2020-02-14 16:40 UTC (permalink / raw)
  To: Alistair Francis; +Cc: GNU C Library

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
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
  2020-01-31 17:03 [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex Alistair Francis
  2020-01-31 21:47 ` Arnd Bergmann
  2020-02-14 16:40 ` Alistair Francis
@ 2020-02-14 17:55 ` Adhemerval Zanella
  2 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2020-02-14 17:55 UTC (permalink / raw)
  To: libc-alpha



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
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-14 17:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 17:03 [PATCH] tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex Alistair Francis
2020-01-31 21:47 ` Arnd Bergmann
2020-01-31 23:46   ` Alistair Francis
2020-02-14 16:40 ` Alistair Francis
2020-02-14 17:55 ` Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2019-11-12 17:36 Alistair Francis
2019-12-03 18:56 ` Alistair Francis
2019-12-09 18:54   ` Alistair Francis
2019-12-20  4:02     ` Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).