ioctl_userfaultfd(2) System Calls Manual ioctl_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 of UFFD* constants */
#include <sys/ioctl.h>
int ioctl(int fd, int op, ...);

Various ioctl(2) operations can be performed on a userfaultfd object (created by a call to userfaultfd(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, and argp is a pointer to a data structure that is specific to op.

The various ioctl(2) operations are described below. The UFFDIO_API, UFFDIO_REGISTER, and UFFDIO_UNREGISTER operations are used to configure 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 are range operations. These operations enable the calling application to resolve page-fault events.

On success, 0 is returned. On error, -1 is returned, and errno is set to indicate the error.

The following general errors can occur for all of the operations described above:

argp does not point to a valid memory address.
(For all operations except UFFDIO_API.) The userfaultfd object has not yet been enabled (via the UFFDIO_API operation).

Linux.

See userfaultfd(2).

ioctl(2), mmap(2), userfaultfd(2)

linux.git/Documentation/admin-guide/mm/userfaultfd.rst

2024-06-14 Linux man-pages 6.9.1