0001-Define-SYS_futex-on-32bit-arches-using-64-bit-time_t.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From a20107ab47554798e0de0347dd4d7259f01675af Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sun, 15 Nov 2020 16:33:45 -0800
  4. Subject: [PATCH] Define SYS_futex on 32bit arches using 64-bit time_t
  5. Newer 32bit arches like RISCV32 and ARC are using 64bit time_t
  6. from get go unlike other 32bit architecture therefore aliasing __NR_futex to
  7. __NR_futex_time64 helps avoid the below errors
  8. tst_checkpoint.c:99:17: error: use of undeclared identifier 'SYS_futex'
  9. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  10. [ moved definitions to lapi/futex.h ]
  11. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
  12. ---
  13. include/lapi/futex.h | 4 ++++
  14. testcases/kernel/syscalls/clone/clone08.c | 1 +
  15. 2 files changed, 5 insertions(+)
  16. diff --git a/include/lapi/futex.h b/include/lapi/futex.h
  17. index 72209e4c98..00b26c3559 100644
  18. --- a/include/lapi/futex.h
  19. +++ b/include/lapi/futex.h
  20. @@ -10,4 +10,8 @@
  21. typedef volatile uint32_t futex_t;
  22. +#if !defined(SYS_futex) && defined(SYS_futex_time64)
  23. +#define SYS_futex SYS_futex_time64
  24. +#endif
  25. +
  26. #endif /* LAPI_FUTEX_H__ */
  27. diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
  28. index 8e115b0421..3de1fe9bbd 100644
  29. --- a/testcases/kernel/syscalls/clone/clone08.c
  30. +++ b/testcases/kernel/syscalls/clone/clone08.c
  31. @@ -16,6 +16,7 @@
  32. #include "tst_test.h"
  33. #include "clone_platform.h"
  34. #include "lapi/syscalls.h"
  35. +#include "lapi/futex.h"
  36. static pid_t ptid, ctid, tgid;
  37. static void *child_stack;