Correct futex_wake and futex_wake_bitset nr_wake argument usage
The syscall wrappers accepted a val and an nr_wake argument, while
these two calls ignore the val of the uaddr.
Reported-by: Michel Lespinasse <walken@google.com>
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
diff --git a/functional/futex_requeue_pi_mismatched_ops.c b/functional/futex_requeue_pi_mismatched_ops.c
index 50bd07b..529f5a8 100644
--- a/functional/futex_requeue_pi_mismatched_ops.c
+++ b/functional/futex_requeue_pi_mismatched_ops.c
@@ -113,7 +113,7 @@
* requeue_pi target and aborted. Wake the child with
* FUTEX_WAKE.
*/
- ret = futex_wake(&f1, f1, 1, FUTEX_PRIVATE_FLAG);
+ ret = futex_wake(&f1, 1, FUTEX_PRIVATE_FLAG);
if (ret == 1)
ret = 0;
else if (ret < 0)
diff --git a/include/futextest.h b/include/futextest.h
index 2b64f79..3766ad7 100644
--- a/include/futextest.h
+++ b/include/futextest.h
@@ -119,8 +119,8 @@
* futex_wake() - wake one or more tasks blocked on uaddr
* @nr_wake: wake up to this many tasks
*/
-#define futex_wake(uaddr, val, nr_wake, opflags) \
- futex(uaddr, FUTEX_WAKE, val, NULL, NULL, nr_wake, opflags)
+#define futex_wake(uaddr, nr_wake, opflags) \
+ futex(uaddr, FUTEX_WAKE, nr_wake, NULL, NULL, 0, opflags)
/**
* futex_wait_bitset() - block on uaddr with bitset
@@ -133,8 +133,8 @@
* futex_wake_bitset() - wake one or more tasks blocked on uaddr with bitset
* @bitset: bitset to compare with that used in futex_wait_bitset
*/
-#define futex_wake_bitset(uaddr, val, nr_wake, bitset, opflags) \
- futex(uaddr, FUTEX_WAKE_BITSET, val, NULL, NULL, bitset, opflags)
+#define futex_wake_bitset(uaddr, nr_wake, bitset, opflags) \
+ futex(uaddr, FUTEX_WAKE_BITSET, nr_wake, NULL, NULL, bitset, opflags)
/**
* futex_lock_pi() - block on uaddr as a PI mutex