Skip to content

poll

Implemented in Antinomie 0.7.0 · Syscall list

long poll(struct pollfd *ufds, unsigned int nfds, int timeout);
Number (x86-64) 7
ABI common
Kernel entry point sys_poll

This is the raw kernel prototype from the pinned Linux 6.12.94 schema, not the libc wrapper.

Waits until one of a set of file descriptors becomes ready for I/O, or a timeout expires. Each entry lists the events asked for and receives the events found.

Name Type Meaning
ufds (arg0) struct pollfd * Pointer to an array of pollfd structures.
nfds (arg1) unsigned int Number of entries in the array.
timeout (arg2) int Timeout, as a pointer to a time structure or a value in the unit the call uses.

On success: the number of descriptors with events, 0 on timeout.

In an Antinomie trace the Return column and the ret filter field show the raw kernel return value. On failure that is the negative errno, for example -2 for ENOENT, not the -1 plus errno that the libc wrapper gives. syscall.errno holds the positive errno and syscall.success is false.

Raw return Name Meaning
-14 EFAULT A pointer argument points outside the accessible address space.
-4 EINTR The call was interrupted by a signal.
-22 EINVAL An argument is invalid.

poll(2) on man7.org

Coverage mark: Implemented. Every pointer argument has a capture rule in the pinned kernel patch and none of them records a “no decoder”, “address only” or “not observed” gap on any code path. Individual values can still be incomplete on a particular call; see the capture statuses.

Every call is recorded as an Entry record (the six argument words and the pointees copied at entry) and an Exit record (the return value and the pointees copied at exit).

Argument When How Recorded field key Condition
ufds (arg0) Entry the pointer itself, as a raw word args.0, args.raw[0]
↳ pointee Entry and exit array of pollfd, count from nfds (arg1); “invalid extent” if above the descriptor limit arg0.pollfd at exit when the result is 0 or greater, or the call was interrupted
nfds (arg1) Entry raw scalar word args.1, args.nfds
timeout (arg2) Entry raw scalar word args.2, args.timeout
  • Result: ret, syscall.errno, syscall.success, syscall.duration_ns.
  • Argument words: args.ufds (arg0), args.nfds (arg1), args.timeout (arg2); args.0 to args.5 by position.
  • Structure pollfd[] behind ufds (arg0): args.ufds.<member> for events, fd, revents.

See Syscall Trace filter for the full syntax.

For what the capture statuses mean, see Capture statuses. For what is never recorded, see Known gaps.