]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
lib/posix-futex: Ignore FUTEX_PRIVATE_FLAG
authorMarco Schlumpp <marco@unikraft.io>
Mon, 17 Apr 2023 07:57:45 +0000 (09:57 +0200)
committerUnikraft <monkey@unikraft.io>
Sun, 7 May 2023 12:18:32 +0000 (12:18 +0000)
The flag can be specified for all operations and does not make a
difference in the context of a single-process scenario. Therefore, we
can ignore it.

Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Adina Smeu <adina.smeu@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #758

lib/posix-futex/futex.c

index 9c0c26c36c82dcdf51862ac182a5c728e8f722f2..d8eace3210358f78359b7561c68836cdeca02334 100644 (file)
@@ -283,9 +283,8 @@ UK_LLSYSCALL_R_DEFINE(int, futex, uint32_t *, uaddr, int, futex_op,
         * Unikraft. Therefore, we can just use CLOCK_MONOTONIC for timeouts in
         * the following code.
         */
-       switch (futex_op) {
+       switch (futex_op & FUTEX_CMD_MASK) {
        case FUTEX_WAIT:
-       case FUTEX_WAIT_PRIVATE:
                /*
                 * `timeout` is relative to "now" (whenever that is). To
                 * simplify the implementation regarding overflows, we will only
@@ -298,7 +297,6 @@ UK_LLSYSCALL_R_DEFINE(int, futex, uint32_t *, uaddr, int, futex_op,
                return futex_wait(uaddr, val, timeout ? &timeout_ns : NULL);
 
        case FUTEX_WAIT_BITSET:
-       case FUTEX_WAIT_BITSET_PRIVATE:
                /*
                 * Special case implementation for cases where the val3/mask has
                 * all bits set. Some applications do this to use the absolute
@@ -314,7 +312,6 @@ UK_LLSYSCALL_R_DEFINE(int, futex, uint32_t *, uaddr, int, futex_op,
                return futex_wait(uaddr, val, timeout ? &timeout_ns : NULL);
 
        case FUTEX_WAKE:
-       case FUTEX_WAKE_PRIVATE:
                return futex_wake(uaddr, val);
 
        case FUTEX_FD: