| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE) |
| 4 |
.\" may be freely modified and distributed |
| 5 |
.\" %%%LICENSE_END |
| 6 |
.\" |
| 7 |
.TH FUTEX_UNLOCK_PI 2const 2025-05-30 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
FUTEX_UNLOCK_PI \- unlock a priority‐inheritance futex |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#include <linux/futex.h>" " /* Definition of " FUTEX_* " constants */" |
| 16 |
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */" |
| 17 |
.B #include <unistd.h> |
| 18 |
.P |
| 19 |
.BI "long syscall(SYS_futex, uint32_t *" uaddr ", FUTEX_UNLOCK_PI);" |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
This operation wakes the top priority waiter that is waiting in |
| 23 |
.BR FUTEX_LOCK_PI (2const) |
| 24 |
or |
| 25 |
.BR FUTEX_LOCK_PI2 (2const) |
| 26 |
on the futex address provided by the |
| 27 |
.I uaddr |
| 28 |
argument. |
| 29 |
.P |
| 30 |
This is called when the user-space value at |
| 31 |
.I uaddr |
| 32 |
cannot be changed atomically from a TID (of the owner) to 0. |
| 33 |
.\" |
| 34 |
.SH RETURN VALUE |
| 35 |
On error, |
| 36 |
\-1 is returned, |
| 37 |
and |
| 38 |
.I errno |
| 39 |
is set to indicate the error. |
| 40 |
.P |
| 41 |
On success, |
| 42 |
.B FUTEX_UNLOCK_PI |
| 43 |
returns 0 if the futex was successfully unlocked. |
| 44 |
.SH ERRORS |
| 45 |
See |
| 46 |
.BR futex (2). |
| 47 |
.TP |
| 48 |
.B EINVAL |
| 49 |
The kernel detected an inconsistency between the user-space state at |
| 50 |
.I uaddr |
| 51 |
and the kernel state. |
| 52 |
This indicates either state corruption |
| 53 |
or that the kernel found a waiter on |
| 54 |
.I uaddr |
| 55 |
which is waiting via |
| 56 |
.BR FUTEX_WAIT (2const) |
| 57 |
or |
| 58 |
.BR FUTEX_WAIT_BITSET (2const). |
| 59 |
.TP |
| 60 |
.B ENOSYS |
| 61 |
A run-time check determined that the operation is not available. |
| 62 |
The PI-futex operations are not implemented on all architectures and |
| 63 |
are not supported on some CPU variants. |
| 64 |
.TP |
| 65 |
.B EPERM |
| 66 |
The caller does not own the lock represented by the futex word. |
| 67 |
.SH STANDARDS |
| 68 |
Linux. |
| 69 |
.SH HISTORY |
| 70 |
Linux 2.6.18. |
| 71 |
.\" commit c87e2837be82df479a6bae9f155c43516d2feebc |
| 72 |
.SH SEE ALSO |
| 73 |
.BR futex (2) |