Skip to content

Commit 603c303

Browse files
mtjhrcslp
authored andcommitted
utils/macos/eventfd: Ignore EFD_SEMAPHORE flag
We don't fully support the same semantics as Linux (this is also true for non-semaphore default), but this should be close-enough for now. Signed-off-by: Matej Hrica <[email protected]>
1 parent c9621c9 commit 603c303

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils/src/macos/eventfd.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ use libc::{c_void, dup, fcntl, pipe, read, write, F_GETFL, F_SETFL, O_NONBLOCK};
1313

1414
pub const EFD_NONBLOCK: i32 = 1;
1515

16+
// NOTE: We introduce the semaphore flag here, but we don't implement the semantics exactly - We don't
17+
// return the correct value from read().
18+
pub const EFD_SEMAPHORE: i32 = 2;
19+
1620
fn set_nonblock(fd: RawFd) -> result::Result<(), io::Error> {
1721
let flags = unsafe { fcntl(fd, F_GETFL) };
1822
if flags < 0 {

0 commit comments

Comments
 (0)