code wiki / (root) / nx_poll.nx

nx_poll.nx

buildroot/runtime/nx_poll.nx

4876 B134 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_poll.nx -- poll(2) and ppoll(2) wrappers. Used by: - Network servers waiting for I/O on N sockets - Build pipelines watching child stdout + stderr in parallel - Async runtimes that need readiness notification Linux RV64 doesn't expose poll() directly -- we use ppoll (syscall 73) with a NULL timespec for the equivalent of poll's blocking behaviour, or a real timespec for timeout. struct pollfd: int fd i32 short events i16 short revents i16 Total = 8 bytes per entry. Caller allocates an array, fills fd + events on each, and reads revents after the syscall.

dependencies 1 imports · 3 importers

syscalls.nx nx_poll.nx nx_sig2_bp_gate.nx nx_signaling_v2.nx nx_sites_daemon_v2.nx

imports: syscalls.nx

imported by: nx_sig2_bp_gate.nxnx_signaling_v2.nxnx_sites_daemon_v2.nx

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

main nx_pollfd_set nx_pollfd_revents nx_poll nx_ppoll

structs

none

consts

27const NX_MAGIC_1000000: i64 = 1000000
36const NX_SYS_PPOLL: i64 = 271
39const NX_SYS_PPOLL: i64 = 73
43const NX_POLLIN: i64 = 0x0001
44const NX_POLLPRI: i64 = 0x0002
45const NX_POLLOUT: i64 = 0x0004
46const NX_POLLERR: i64 = 0x0008
47const NX_POLLHUP: i64 = 0x0010
48const NX_POLLNVAL: i64 = 0x0020
49const NX_POLLRDNORM: i64 = 0x0040
50const NX_POLLRDBAND: i64 = 0x0080
51const NX_POLLWRNORM: i64 = 0x0100
52const NX_POLLWRBAND: i64 = 0x0200
54const NX_POLLFD_BYTES: i64 = 8

functions

57func nx_pollfd_set(pfds: *u8, i: i64, fd: i64, events: i64) -> i64
called by 3: mainmainsd2_ws_pump
71func nx_pollfd_revents(pfds: *u8, i: i64) -> i64
called by 3: mainmainsd2_ws_pump
80func nx_ppoll(pfds: *u8, n: i64, timeout_ts: i64, sigmask: i64) -> i64
called by 1: nx_poll
86func nx_poll(pfds: *u8, n: i64, timeout_ms: i64) -> i64
called by 3: mainmainsd2_ws_pump calls 1: nx_ppoll
99func main() -> i64