NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUE | ERRORS | STANDARDS | HISTORY | SEE ALSO | COLOPHON |
|
|
FUTEX_FD(2const) FUTEX_FD(2const)
FUTEX_FD - create a file descriptor associated with a futex
Standard C library (libc, -lc)
#include <linux/futex.h> /* Definition of FUTEX_* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */ #include <unistd.h> [[deprecated]] long syscall(SYS_futex, uint32_t *uaddr, FUTEX_FD, uint32_t val);
This operation creates a file descriptor that is associated with the futex at uaddr. The caller must close the returned file descriptor after use. When another process or thread performs a FUTEX_WAKE(2const) on the futex word, the file descriptor indicates as being readable with select(2), poll(2), and epoll(7) The file descriptor can be used to obtain asynchronous notifications: if val is nonzero, then, when another process or thread executes a FUTEX_WAKE(2const), the caller will receive the signal number that was passed in val.
On error, -1 is returned, and errno is set to indicate the error. On success, FUTEX_FD Returns the new file descriptor associated with the futex.
See futex(2). EINVAL The signal number supplied in val is invalid. ENFILE The system-wide limit on the total number of open files has been reached.
Linux.
From Linux 2.6.0 up to and including Linux 2.6.25. Because it was inherently racy, FUTEX_FD has been removed from Linux 2.6.26 onward.
futex(2)
This page is part of the man-pages (Linux kernel and C library
user-space interface documentation) project. Information about
the project can be found at
⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report
for this manual page, see
⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩.
This page was obtained from the tarball man-pages-6.15.tar.gz
fetched from
⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on
2025-08-11. If you discover any rendering problems in this HTML
version of the page, or you believe there is a better or more up-
to-date source for the page, or you have corrections or
improvements to the information in this COLOPHON (which is not
part of the original manual page), send a mail to
man-pages@man7.org
Linux man-pages 6.15 2025-05-30 FUTEX_FD(2const)
Pages that refer to this page: futex(2)
Copyright and license for this manual page