0 on success, or -1 with errno set on failure (e.g., EAGAIN
if the counter is currently zero).
Read and reset an eventfd counter.
Reads the current eventfd counter value and resets it to zero, consuming the wakeup notification. This should be called when the eventfd becomes readable.
handle | The eventfd handle to read from. |
counter | Output parameter receiving the counter value before reset. |
0 on success, or -1 with errno set on failure (e.g., EAGAIN
if the counter is currently zero).