Skip to content

Commit 3e06024

Browse files
andrealmeidxdevs23
authored andcommitted
futex: Add Proton compatibility code
Signed-off-by: Simão Gomes Viana <[email protected]>
1 parent c812e77 commit 3e06024

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

include/uapi/linux/futex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define FUTEX_WAKE_BITSET 10
2222
#define FUTEX_WAIT_REQUEUE_PI 11
2323
#define FUTEX_CMP_REQUEUE_PI 12
24-
#define FUTEX_WAIT_MULTIPLE 13
24+
#define FUTEX_WAIT_MULTIPLE 31
2525

2626
#define FUTEX_PRIVATE_FLAG 128
2727
#define FUTEX_CLOCK_REALTIME 256

kernel/futex.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,7 +4075,7 @@ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
40754075
return -EINVAL;
40764076

40774077
t = timespec64_to_ktime(ts);
4078-
if (cmd == FUTEX_WAIT)
4078+
if (cmd == FUTEX_WAIT || cmd == FUTEX_WAIT_MULTIPLE)
40794079
t = ktime_add_safe(ktime_get(), t);
40804080
else if (!(op & FUTEX_CLOCK_REALTIME))
40814081
t = timens_ktime_to_host(CLOCK_MONOTONIC, t);
@@ -4278,6 +4278,7 @@ COMPAT_SYSCALL_DEFINE3(get_robust_list, int, pid,
42784278
*/
42794279
struct compat_futex_wait_block {
42804280
compat_uptr_t uaddr;
4281+
__u32 pad;
42814282
__u32 val;
42824283
__u32 bitset;
42834284
};
@@ -4340,7 +4341,7 @@ SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val,
43404341
return -EINVAL;
43414342

43424343
t = timespec64_to_ktime(ts);
4343-
if (cmd == FUTEX_WAIT)
4344+
if (cmd == FUTEX_WAIT || cmd == FUTEX_WAIT_MULTIPLE)
43444345
t = ktime_add_safe(ktime_get(), t);
43454346
else if (!(op & FUTEX_CLOCK_REALTIME))
43464347
t = timens_ktime_to_host(CLOCK_MONOTONIC, t);

0 commit comments

Comments
 (0)