code wiki / (root) / nx_eventfd.nx

nx_eventfd.nx

buildroot/runtime/nx_eventfd.nx

3297 B105 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_eventfd.nx -- Linux eventfd(2) wrapper. eventfd creates a file descriptor backed by a kernel-managed 64-bit counter. Useful for: - Lightweight thread / coroutine signaling - Adding a "wake up the poll loop" channel to a poll/epoll set - Cross-process counters that don't need shared memory Read returns the counter and resets it to 0 (or decrements by 1 if SEMAPHORE flag was set). Write adds the value to the counter (saturating at 0xFFFFFFFFFFFFFFFE). Linux RV64 syscall: 19 (eventfd2). Flags: NX_EFD_SEMAPHORE / NX_EFD_NONBLOCK / NX_EFD_CLOEXEC.

dependencies 1 imports · 0 importers

syscalls.nx nx_eventfd.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_eventfd_new nx_eventfd_read sys_read nx_eventfd_write nx_eventfd_signal nx_eventfd_write ↻

structs

none

consts

24const NX_SYS_EVENTFD2: i64 = 19
26const NX_EFD_SEMAPHORE: i64 = 1
27const NX_EFD_NONBLOCK: i64 = 0x800
28const NX_EFD_CLOEXEC: i64 = 0x80000

functions

32func nx_eventfd_new(init: i64, flags: i64) -> i64
called by 1: main
38func nx_eventfd_read(fd: i64, out: *i64) -> i64
called by 1: main calls 1: sys_read
43func nx_eventfd_write(fd: i64, v: i64) -> i64
51func nx_eventfd_signal(fd: i64) -> i64
called by 1: main calls 1: nx_eventfd_write
57func main() -> i64