eventfd_ctx...e_wait_queue(9)
π eventfd_ctx_remove_wait_queue β Kernel API Manual β¨
okay so bestie, welcome to the Kernel API Manual, and today's main character is eventfd_ctx_remove_wait_queue β yes the title is truncated in the header (eventfd_ctx...e_wait_queue(9), we don't know her full name, she's mysterious like that π
).
πΈ NAME πΈ
eventfd_ctx_remove_wait_queue β read the current counter and removes wait queue. two things, one function, she's multitasking, we stan π«Ά
β SYNOPSIS β
int eventfd_ctx_remove_wait_queue (struct eventfd_ctx *ctx ,
wait_queue_entry_t *wait , __u64 *cnt );
literally just three args, no cap. look at her go π¦
π ARGUMENTS π
ctxβ[in]Pointer to eventfd context. yes it's in, meaning you're feeding it in, you're the giver here πwaitβ[in]Wait queue to be removed. this is the entry getting yeeted out of the queue, byeee πcntβ[out]Pointer to the 64-bit counter value. this one's out β the function writes the 64-bit counter value back to you through this pointer. she's giving, you're receiving π«
π₯ DESCRIPTION π₯
Returns 0 if successful, or the following error codes:
-EAGAIN: The operation would have blocked.
lowkey important: -EAGAIN here means the operation would have blocked β that's the whole mood of that error code, don't forget it π
This is used to atomically remove a wait queue entry from the eventfd wait queue head, and read/reset the counter value. like, all of it, in one atomic little motion β no half-steps, no race conditions, no drama. the way she does remove + read + reset as one unit?? iconic π
π¦ SEE ALSO π¦
Kernel file ./fs/eventfd.c β go read the source bestie, it's all in there π
eventfd_signal_mask(9)eventfd_ctx_put(9)eventfd_fget(9)eventfd_ctx_fdget(9)eventfd_ctx_fileget(9)
the whole friend group honestly, they all hang out in ./fs π
and that's the page, bestie!! π this one's from ./fs, dated October 2026, and it's filed under eventfd_ctx...e_wait_queue(9) β same truncated queen energy in the footer as in the header, she's consistent, periodt. go forth and remove those wait queue entries atomically β¨π§
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms