Skip to content

Commit

Permalink
Define SYS_futex on 32bit arches using 64-bit time_t
Browse files Browse the repository at this point in the history
Newer 32bit arches like RISCV32 and ARC are using 64bit time_t
from get go unlike other 32bit architecture therefore aliasing __NR_futex to
__NR_futex_time64 helps avoid the below errors

tst_checkpoint.c:99:17: error: use of undeclared identifier 'SYS_futex'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
[ moved definitions to lapi/futex.h ]
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
  • Loading branch information
kraj authored and pevik committed Nov 16, 2020
1 parent 6f36270 commit a20107a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/lapi/futex.h
Expand Up @@ -10,4 +10,8 @@

typedef volatile uint32_t futex_t;

#if !defined(SYS_futex) && defined(SYS_futex_time64)
#define SYS_futex SYS_futex_time64
#endif

#endif /* LAPI_FUTEX_H__ */
1 change: 1 addition & 0 deletions testcases/kernel/syscalls/clone/clone08.c
Expand Up @@ -16,6 +16,7 @@
#include "tst_test.h"
#include "clone_platform.h"
#include "lapi/syscalls.h"
#include "lapi/futex.h"

static pid_t ptid, ctid, tgid;
static void *child_stack;
Expand Down

0 comments on commit a20107a

Please sign in to comment.