---
name: "ioctl_userfaultfd"
section: "2"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ioctl_userfaultfd"
---

# ioctl\_userfaultfd(2)

create a file descriptor for handling page faults in user space

## NAME

ioctl\_userfaultfd - create a file descriptor for handling page faults in user space

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <linux/userfaultfd.h>  /* Definition of UFFD* constants */
#include <sys/ioctl.h>
```

**int ioctl(int** *fd***, int** *op***, ...);**

## DESCRIPTION

Various [**ioctl**(2)](/ioctl/2.md) operations can be performed on a userfaultfd object (created by a call to [**userfaultfd**(2)](/userfaultfd/2.md)) 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)](/ioctl/2.md) 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.

- [**UFFDIO\_API**(2const)](/UFFDIO_API/2const.md) [**UFFDIO\_REGISTER**(2const)](/UFFDIO_REGISTER/2const.md) [**UFFDIO\_UNREGISTER**(2const)](/UFFDIO_UNREGISTER/2const.md) [**UFFDIO\_COPY**(2const)](/UFFDIO_COPY/2const.md) [**UFFDIO\_MOVE**(2const)](/UFFDIO_MOVE/2const.md) [**UFFDIO\_ZEROPAGE**(2const)](/UFFDIO_ZEROPAGE/2const.md) [**UFFDIO\_WAKE**(2const)](/UFFDIO_WAKE/2const.md) [**UFFDIO\_WRITEPROTECT**(2const)](/UFFDIO_WRITEPROTECT/2const.md) [**UFFDIO\_RWPROTECT**(2const)](/UFFDIO_RWPROTECT/2const.md) [**UFFDIO\_CONTINUE**(2const)](/UFFDIO_CONTINUE/2const.md) [**UFFDIO\_POISON**(2const)](/UFFDIO_POISON/2const.md) [**UFFDIO\_SET\_MODE**(2const)](/UFFDIO_SET_MODE/2const.md)

  ## RETURN VALUE

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

## ERRORS

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

- **EFAULT**

  *argp* does not point to a valid memory address.

- **EINVAL**

  (For all operations except **UFFDIO\_API**.) The userfaultfd object has not yet been enabled (via the **UFFDIO\_API** operation).

## STANDARDS

Linux.

## EXAMPLES

See [**userfaultfd**(2)](/userfaultfd/2.md).

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md), [**mmap**(2)](/mmap/2.md), [**userfaultfd**(2)](/userfaultfd/2.md)

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