Skip to content

waitid

Implemented in Antinomie 0.7.0 · Syscall list

long waitid(int which, pid_t pid, struct siginfo *infop, int options, struct rusage *ru);
Number (x86-64) 247
ABI 64
Kernel entry point sys_waitid

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

Waits for a child to change state, selecting by pid, group or any, and fills in a siginfo.

Name Type Meaning
which (arg0) int Selects which object or timer the call applies to.
pid (arg1) pid_t Process or thread id.
infop (arg2) struct siginfo * Pointer to a siginfo structure.
options (arg3) int Option flags.
ru (arg4) struct rusage * Pointer to a resource usage structure the kernel fills.

On success: 0.

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
-10 ECHILD There is no child to wait for.
-4 EINTR The call was interrupted by a signal.

waitid(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
which (arg0) Entry raw scalar word args.0, args.which
pid (arg1) Entry raw scalar word args.1, args.pid
infop (arg2) Entry the pointer itself, as a raw word args.2, args.raw[2]
↳ pointee Exit structure siginfo_t (fixed size) arg2.data result is 0
options (arg3) Entry raw scalar word; Syscall Trace also decodes it into flag names (waitid group), listing unknown bits separately args.3, args.options
ru (arg4) Entry the pointer itself, as a raw word args.4, args.raw[4]
↳ pointee Exit structure rusage (fixed size) arg4.data result is 0
  • Result: ret, syscall.errno, syscall.success, syscall.duration_ns.
  • Argument words: args.which (arg0), args.pid (arg1), args.infop (arg2), args.options (arg3), args.ru (arg4); args.0 to args.5 by position.
  • Structure siginfo_t behind infop (arg2): args.infop.<member> for _si_pad[0], _si_pad[10], _si_pad[11], _si_pad[12], _si_pad[13], _si_pad[14], _si_pad[15], _si_pad[16], _si_pad[17], _si_pad[18], _si_pad[19], _si_pad[1], _si_pad[20], _si_pad[21], _si_pad[22], _si_pad[23], _si_pad[24], _si_pad[25], _si_pad[26], _si_pad[27], _si_pad[28], _si_pad[29], _si_pad[2], _si_pad[30], _si_pad[31], _si_pad[3], _si_pad[4], _si_pad[5], _si_pad[6], _si_pad[7], _si_pad[8], _si_pad[9], si_code, si_errno, si_signo.
  • Structure rusage behind ru (arg4): args.ru.<member> for ru_idrss, ru_inblock, ru_isrss, ru_ixrss, ru_majflt, ru_maxrss, ru_minflt, ru_msgrcv, ru_msgsnd, ru_nivcsw, ru_nsignals, ru_nswap, ru_nvcsw, ru_oublock, ru_stime.tv_sec, ru_stime.tv_usec, ru_utime.tv_sec, ru_utime.tv_usec.

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.