nx_eventfd.nx
buildroot/runtime/nx_eventfd.nx
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
imports: syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 24 | const NX_SYS_EVENTFD2: i64 = 19 |
| 26 | const NX_EFD_SEMAPHORE: i64 = 1 |
| 27 | const NX_EFD_NONBLOCK: i64 = 0x800 |
| 28 | const NX_EFD_CLOEXEC: i64 = 0x80000 |
functions
| 32 | func nx_eventfd_new(init: i64, flags: i64) -> i64 called by 1: main |
| 38 | func nx_eventfd_read(fd: i64, out: *i64) -> i64 |
| 43 | func nx_eventfd_write(fd: i64, v: i64) -> i64 |
| 51 | func nx_eventfd_signal(fd: i64) -> i64 |
| 57 | func main() -> i64 |