Skip to content

Commit

Permalink
Rework ck_ec tests when invoking FUTEX_WAIT_BITSET
Browse files Browse the repository at this point in the history
Send FUTEX_BITSET_MATCH_ANY as the SYS_futex `val3` argument instead of
the deadline pointer, as deadline can be NULL which will result in the
futex call failing with EINVAL (val3 must have at least one bit set).
  • Loading branch information
michael-grunder authored and pkhuong committed Mar 29, 2021
1 parent da15a74 commit e18e9d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions regressions/ck_ec/benchmark/ck_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static void wait32(const struct ck_ec_wait_state *state,
assert(state->ops == &test_ops);
syscall(SYS_futex, address,
FUTEX_WAIT_BITSET, expected, deadline,
NULL, deadline, 0);
NULL, FUTEX_BITSET_MATCH_ANY, 0);
return;
}

Expand All @@ -143,7 +143,7 @@ static void wait64(const struct ck_ec_wait_state *state,

syscall(SYS_futex, low_half,
FUTEX_WAIT_BITSET, (uint32_t)expected, deadline,
NULL, deadline, 0);
NULL, FUTEX_BITSET_MATCH_ANY, 0);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions regressions/ck_ec/validate/ck_ec_smoke_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void wait32(const struct ck_ec_wait_state *state,
assert(state->ops == &test_ops);
syscall(SYS_futex, address,
FUTEX_WAIT_BITSET, expected, deadline,
NULL, deadline, 0);
NULL, FUTEX_BITSET_MATCH_ANY, 0);
return;
}

Expand All @@ -68,7 +68,7 @@ static void wait64(const struct ck_ec_wait_state *state,

syscall(SYS_futex, low_half,
FUTEX_WAIT_BITSET, (uint32_t)expected, deadline,
NULL, deadline, 0);
NULL, FUTEX_BITSET_MATCH_ANY, 0);
return;
}

Expand Down

0 comments on commit e18e9d0

Please sign in to comment.