nx_poll.nx
buildroot/runtime/nx_poll.nx
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
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
structs
| none |
consts
| 27 | const NX_MAGIC_1000000: i64 = 1000000 |
| 36 | const NX_SYS_PPOLL: i64 = 271 |
| 39 | const NX_SYS_PPOLL: i64 = 73 |
| 43 | const NX_POLLIN: i64 = 0x0001 |
| 44 | const NX_POLLPRI: i64 = 0x0002 |
| 45 | const NX_POLLOUT: i64 = 0x0004 |
| 46 | const NX_POLLERR: i64 = 0x0008 |
| 47 | const NX_POLLHUP: i64 = 0x0010 |
| 48 | const NX_POLLNVAL: i64 = 0x0020 |
| 49 | const NX_POLLRDNORM: i64 = 0x0040 |
| 50 | const NX_POLLRDBAND: i64 = 0x0080 |
| 51 | const NX_POLLWRNORM: i64 = 0x0100 |
| 52 | const NX_POLLWRBAND: i64 = 0x0200 |
| 54 | const NX_POLLFD_BYTES: i64 = 8 |
functions
| 57 | func nx_pollfd_set(pfds: *u8, i: i64, fd: i64, events: i64) -> i64 |
| 71 | func nx_pollfd_revents(pfds: *u8, i: i64) -> i64 |
| 80 | func nx_ppoll(pfds: *u8, n: i64, timeout_ts: i64, sigmask: i64) -> i64 called by 1: nx_poll |
| 86 | func nx_poll(pfds: *u8, n: i64, timeout_ms: i64) -> i64 |
| 99 | func main() -> i64 |