aboutsummaryrefslogtreecommitdiffstats
path: root/man/man2const/FUTEX_WAKE.2const
blob: 052e7cbc69913f6e63b2f5ab596b3c5edbc63428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE)
.\" may be freely modified and distributed
.\" %%%LICENSE_END
.\"
.TH FUTEX_WAKE 2const (date) "Linux man-pages (unreleased)"
.SH NAME
FUTEX_WAKE \- wake waiters that are inside FUTEX_WAIT
.SH LIBRARY
Standard C library
.RI ( libc ,\~ \-lc )
.SH SYNOPSIS
.nf
.BR "#include <linux/futex.h>" "  /* Definition of " FUTEX_* " constants */"
.BR "#include <sys/syscall.h>" "  /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.P
.BI "long syscall(SYS_futex, uint32_t *" uaddr ", FUTEX_WAKE, uint32_t " val );
.fi
.SH DESCRIPTION
This operation wakes at most
.I val
of the waiters that are waiting (e.g., inside
.BR FUTEX_WAIT (2const))
on the futex word at the address
.IR uaddr .
.P
Most commonly,
.I val
is specified as either 1 (wake up a single waiter) or
.B INT_MAX
(wake up all waiters).
.P
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).
.\" FIXME . (Torvald) I think we should remove this.  Or maybe adapt to
.\" a different example.
.\"
.\"     For
.\"     .BR futex (7),
.\"     this is executed if incrementing the count showed that
.\"     there were waiters,
.\"     once the futex value has been set to 1
.\"     (indicating that it is available).
.\"
.\" How does "incrementing the count show that there were waiters"?
.\"
.SH RETURN VALUE
On error,
\-1 is returned,
and
.I errno
is set to indicate the error.
.P
On success,
.B FUTEX_WAKE
returns the number of waiters that were woken up.
.SH ERRORS
See
.BR futex (2).
.TP
.B EINVAL
The kernel detected an inconsistency between the user-space state at
.I uaddr
and the kernel state\[em]that is, it detected a waiter which waits in
.BR FUTEX_LOCK_PI (2const)
or
.BR FUTEX_LOCK_PI2 (2const)
on
.IR uaddr .
.SH STANDARDS
Linux.
.SH HISTORY
Linux 2.6.0.
.\" Strictly speaking, since Linux 2.5.x
.SH SEE ALSO
.BR futex (2)