NAME |LIBRARY |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |STANDARDS |EXAMPLES |SEE ALSO |COLOPHON | |
ioctl_userfaultfd(2) System Calls Manualioctl_userfaultfd(2)ioctl_userfaultfd - create a file descriptor for handling page faults in user space
Standard C library (libc,-lc)
#include <linux/userfaultfd.h>/* Definition ofUFFD*constants */#include <sys/ioctl.h>int ioctl(intfd, intop, ...);
Variousioctl(2) operations can be performed on a userfaultfd object (created by a call touserfaultfd(2)) using calls of the form: ioctl(fd, op, argp); In the above,fd is a file descriptor referring to a userfaultfd object,op is one of the operations listed below, andargp is a pointer to a data structure that is specific toop. The variousioctl(2) operations are described below. TheUFFDIO_API,UFFDIO_REGISTER, andUFFDIO_UNREGISTERoperations are used toconfigure userfaultfd behavior. These operations allow the caller to choose what features will be enabled and what kinds of events will be delivered to the application. The remaining operations arerange operations. These operations enable the calling application to resolve page-fault events.UFFDIO_API(2const)UFFDIO_REGISTER(2const)UFFDIO_UNREGISTER(2const)UFFDIO_COPY(2const)UFFDIO_MOVE(2const)UFFDIO_ZEROPAGE(2const)UFFDIO_WAKE(2const)UFFDIO_WRITEPROTECT(2const)UFFDIO_CONTINUE(2const)UFFDIO_POISON(2const)
On success, 0 is returned. On error, -1 is returned, anderrno is set to indicate the error.
The following general errors can occur for all of the operations described above:EFAULTargp does not point to a valid memory address.EINVAL(For all operations exceptUFFDIO_API.) The userfaultfd object has not yet been enabled (via theUFFDIO_API operation).
Linux.
Seeuserfaultfd(2).
ioctl(2),mmap(2),userfaultfd(2)linux.git/Documentation/admin-guide/mm/userfaultfd.rst
This page is part of theman-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 isnot part of the original manual page), send a mail to man-pages@man7.orgLinux man-pages 6.15 2025-05-17ioctl_userfaultfd(2)Pages that refer to this page:ioctl(2), UFFDIO_API(2const), UFFDIO_CONTINUE(2const), UFFDIO_COPY(2const), UFFDIO_MOVE(2const), UFFDIO_POISON(2const), UFFDIO_REGISTER(2const), UFFDIO_UNREGISTER(2const), UFFDIO_WAKE(2const), UFFDIO_WRITEPROTECT(2const), UFFDIO_ZEROPAGE(2const), userfaultfd(2)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |