Function hermit_abi::eventfd

source ·
pub unsafe extern "C" fn eventfd(initval: u64, flags: i16) -> i32
Expand description

eventfd creates an linux-like “eventfd object” that can be used as an event wait/notify mechanism by user-space applications, and by the kernel to notify user-space applications of events. The object contains an unsigned 64-bit integer counter that is maintained by the kernel. This counter is initialized with the value specified in the argument initval.

As its return value, eventfd returns a new file descriptor that can be used to refer to the eventfd object.

The following values may be bitwise set in flags to change the behavior of eventfd:

EFD_NONBLOCK: Set the file descriptor in non-blocking mode EFD_SEMAPHORE: Provide semaphore-like semantics for reads from the new file descriptor.