]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2/futex.2, man/man2const/FUTEX_FD.2const: Split FUTEX_FD from futex(2)
authorAlejandro Colomar <alx@kernel.org>
Wed, 28 May 2025 20:05:12 +0000 (22:05 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 30 May 2025 12:42:28 +0000 (14:42 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2/futex.2
man/man2const/FUTEX_FD.2const [new file with mode: 0644]

index 742e0b51a6a9d478a92c54deadc26955f849654f..4a56c003bb3efe7b778c95eafc169c055d189640 100644 (file)
@@ -214,7 +214,7 @@ As a convenience,
 defines a set of constants with the suffix
 .B _PRIVATE
 that are equivalents of all of the operations listed below,
-.\" except the obsolete FUTEX_FD, for which the "private" flag was
+.\" except the obsolete FUTEX_FD(2const), for which the "private" flag was
 .\" meaningless
 but with the
 .B FUTEX_PRIVATE_FLAG
@@ -260,43 +260,8 @@ is one of the following:
 .BR FUTEX_WAIT (2const)
 .TQ
 .BR FUTEX_WAKE (2const)
-.TP
-.BR FUTEX_FD " (from Linux 2.6.0 up to and including Linux 2.6.25)"
-.\" Strictly speaking, from Linux 2.5.x to Linux 2.6.25
-This operation creates a file descriptor that is associated with
-the futex at
-.IR uaddr .
-The caller must close the returned file descriptor after use.
-When another process or thread performs a
-.BR FUTEX_WAKE (2const)
-on the futex word, the file descriptor indicates as being readable with
-.BR select (2),
-.BR poll (2),
-and
-.BR epoll (7)
-.IP
-The file descriptor can be used to obtain asynchronous notifications: if
-.I val
-is nonzero, then, when another process or thread executes a
-.BR FUTEX_WAKE (2const),
-the caller will receive the signal number that was passed in
-.IR val .
-.IP
-The arguments
-.IR timeout ,
-.IR uaddr2 ,
-and
-.I val3
-are ignored.
-.IP
-Because it was inherently racy,
-.B FUTEX_FD
-has been removed
-.\" commit 82af7aca56c67061420d618cc5a30f0fd4106b80
-from Linux 2.6.26 onward.
-.\"
-.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.\"
+.TQ
+.BR FUTEX_FD (2const)
 .TP
 .BR FUTEX_REQUEUE " (since Linux 2.6.0)"
 This operation performs the same task as
@@ -1227,9 +1192,6 @@ is set to indicate the error.
 The return value on success depends on the operation,
 as described in the following list:
 .TP
-.B FUTEX_FD
-Returns the new file descriptor associated with the futex.
-.TP
 .B FUTEX_REQUEUE
 Returns the number of waiters that were woken up.
 .TP
@@ -1413,12 +1375,6 @@ equals
 (i.e., an attempt was made to requeue to the same futex).
 .TP
 .B EINVAL
-.RB ( FUTEX_FD )
-The signal number supplied in
-.I val
-is invalid.
-.TP
-.B EINVAL
 .RB ( FUTEX_WAKE_OP ,
 .BR FUTEX_WAKE_BITSET ,
 .BR FUTEX_REQUEUE ,
@@ -1508,10 +1464,6 @@ argument is not 1.
 .B EINVAL
 Invalid argument.
 .TP
-.B ENFILE
-.RB ( FUTEX_FD )
-The system-wide limit on the total number of open files has been reached.
-.TP
 .B ENOMEM
 .RB ( FUTEX_LOCK_PI ,
 .BR FUTEX_LOCK_PI2 ,
diff --git a/man/man2const/FUTEX_FD.2const b/man/man2const/FUTEX_FD.2const
new file mode 100644 (file)
index 0000000..8072e7b
--- /dev/null
@@ -0,0 +1,77 @@
+.\" Copyright, the authors of the Linux man-pages project
+.\"
+.\" %%%LICENSE_START(FREELY_REDISTRIBUTABLE)
+.\" may be freely modified and distributed
+.\" %%%LICENSE_END
+.\"
+.TH FUTEX_FD 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+FUTEX_FD \- create a file descriptor associated with a futex
+.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
+.B [[deprecated]]
+.BI "long syscall(SYS_futex, uint32_t *" uaddr ", FUTEX_FD, uint32_t " val );
+.fi
+.SH DESCRIPTION
+.TP
+.BR FUTEX_FD " (from Linux 2.6.0 up to and including Linux 2.6.25)"
+.\" Strictly speaking, from Linux 2.5.x to Linux 2.6.25
+This operation creates a file descriptor that is associated with
+the futex at
+.IR uaddr .
+The caller must close the returned file descriptor after use.
+When another process or thread performs a
+.BR FUTEX_WAKE (2const)
+on the futex word, the file descriptor indicates as being readable with
+.BR select (2),
+.BR poll (2),
+and
+.BR epoll (7)
+.IP
+The file descriptor can be used to obtain asynchronous notifications: if
+.I val
+is nonzero, then, when another process or thread executes a
+.BR FUTEX_WAKE (2const),
+the caller will receive the signal number that was passed in
+.IR val .
+.\"
+.SH RETURN VALUE
+On error,
+\-1 is returned,
+and
+.I errno
+is set to indicate the error.
+.P
+On success,
+.B FUTEX_FD
+Returns the new file descriptor associated with the futex.
+.SH ERRORS
+See
+.BR futex (2).
+.TP
+.B EINVAL
+The signal number supplied in
+.I val
+is invalid.
+.TP
+.B ENFILE
+The system-wide limit on the total number of open files has been reached.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+From Linux 2.6.0 up to and including Linux 2.6.25.
+.P
+Because it was inherently racy,
+.B FUTEX_FD
+has been removed
+.\" commit 82af7aca56c67061420d618cc5a30f0fd4106b80
+from Linux 2.6.26 onward.
+.SH SEE ALSO
+.BR futex (2)