Skip to content

futex_wait

Implemented in Antinomie 0.7.0 · Syscall list

long futex_wait(void *uaddr, unsigned long val, unsigned long mask, unsigned int flags, struct __kernel_timespec *timespec, clockid_t clockid);
Number (x86-64) 455
ABI common
Kernel entry point sys_futex_wait

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

Waits on a futex word until it is woken or a timeout, using the newer futex2 interface.

Name Type Meaning
uaddr (arg0) void * Address of a 32-bit futex word.
val (arg1) unsigned long A value.
mask (arg2) unsigned long Bit mask.
flags (arg3) unsigned int Option flags that change the behavior of the call.
timespec (arg4) struct __kernel_timespec * Timeout.
clockid (arg5) clockid_t Clock id.

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
-11 EAGAIN The call would block, or a resource is temporarily unavailable.
-4 EINTR The call was interrupted by a signal.
-110 ETIMEDOUT The operation timed out.

futex(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
uaddr (arg0) Entry the pointer itself, as a raw word args.0, args.raw[0]
↳ pointee Entry the 32-bit futex word; “invalid extent” if the size flag is not 32 bits arg0.futex.observed always
val (arg1) Entry raw scalar word args.1, args.val
mask (arg2) Entry raw scalar word args.2, args.mask
flags (arg3) Entry raw scalar word; Syscall Trace also decodes it into flag names (futex2 group), listing unknown bits separately args.3, args.flags
timespec (arg4) Entry the pointer itself, as a raw word args.4, args.raw[4]
↳ pointee Entry structure timespec arg4.timeout the pointer is not NULL
clockid (arg5) Entry raw scalar word args.5, args.clockid
  • Result: ret, syscall.errno, syscall.success, syscall.duration_ns.
  • Argument words: args.uaddr (arg0), args.val (arg1), args.mask (arg2), args.flags (arg3), args.timespec (arg4), args.clockid (arg5); args.0 to args.5 by position.
  • Structure timespec[2] behind timespec (arg4): args.timespec.<member> for tv_nsec, tv_sec.

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.