tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex

Message ID 20191112173654.19842-1-alistair.francis@wdc.com
State Superseded
Headers show
Series
  • tst-clone3: Use __NR_futex_time64 if we don't have __NR_futex
Related show

Commit Message

Alistair Francis Nov. 12, 2019, 5:36 p.m.
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(+)

-- 
2.23.0

Comments

Alistair Francis Dec. 3, 2019, 6:56 p.m. | #1
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

>
Alistair Francis Dec. 9, 2019, 6:54 p.m. | #2
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

> >
Alistair Francis Dec. 20, 2019, 4:02 a.m. | #3
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

> > >

Patch

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