Skip to content

epoll_wait

Implemented in Antinomie 0.7.0 · Syscall list

long epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
Number (x86-64) 232
ABI common
Kernel entry point sys_epoll_wait

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

Waits for events on an epoll instance and returns them in an array.

Name Type Meaning
epfd (arg0) int File descriptor of an epoll instance.
events (arg1) struct epoll_event * Pointer to an array of event structures, or an event mask.
maxevents (arg2) int Maximum number of events to return.
timeout (arg3) int Timeout, as a pointer to a time structure or a value in the unit the call uses.

On success: the number of ready 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
-9 EBADF A file descriptor is not valid for this operation.
-4 EINTR The call was interrupted by a signal.
-22 EINVAL An argument is invalid.

epoll_wait(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
epfd (arg0) Entry raw scalar word args.0, args.epfd
events (arg1) Entry the pointer itself, as a raw word args.1, args.raw[1]
↳ pointee Exit array of epoll_event, count min(result, maxevents) arg1.epoll_events result is 0 or greater
maxevents (arg2) Entry raw scalar word args.2, args.maxevents
timeout (arg3) Entry raw scalar word args.3, args.timeout
  • Result: ret, syscall.errno, syscall.success, syscall.duration_ns.
  • Argument words: args.epfd (arg0), args.events (arg1), args.maxevents (arg2), args.timeout (arg3); args.0 to args.5 by position.
  • Structure epoll_event[] behind events (arg1): args.events.<member> for data, events.

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.