FUTEX_WAKE(2const)

FUTEX_WAKE2const

Wake waiters that are inside futex_wait

Usage

#include <linux/futex.h>  /* Definition of FUTEX_* constants */
#include <sys/syscall.h>  /* Definition of SYS_* constants */
#include <unistd.h>

long syscall(SYS_futex, uint32_t *uaddr, FUTEX_WAKE, uint32_t val);

Library

Standard C library (libc, -lc)

Overview

This operation wakes at most val of the waiters that are waiting (e.g., inside FUTEX_WAIT(2const)) on the futex word at the address uaddr.

Most commonly, val is specified as either 1 (wake up a single waiter) or INT_MAX (wake up all waiters).

No guarantee is provided about which waiters are awoken (e.g., a waiter with a higher scheduling priority is not guaranteed to be awoken in preference to a waiter with a lower priority).

Return value

On error, -1 is returned, and errno is set to indicate the error.

On success, FUTEX_WAKE returns the number of waiters that were woken up.

Errors

See futex(2).

EINVAL

The kernel detected an inconsistency between the user-space state at uaddr and the kernel state—that is, it detected a waiter which waits in FUTEX_LOCK_PI(2const) or FUTEX_LOCK_PI2(2const) on uaddr.

Standards

Linux.

History

Linux 2.6.0.

From man-pages 6.19-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.