ioctl_userfaultfd(2)
β¨ ioctl_userfaultfd π
okay bestie, welcome to the ioctl_userfaultfd page, straight out of the System Calls Manual β¨ this one's all about create a file descriptor for handling page faults in user space π¦ like, userfaultfd but the ioctl half. no cap, she's iconic.
πΈ 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
sooooo there's a bunch of ioctl(2) operations you can do on a userfaultfd object (that's the thing you get from calling userfaultfd(2), btw) and you do them like this:
ioctl(fd, op, argp);
let's break that down fr fr:
fdis a file descriptor pointing at a userfaultfd object πopis one of the operations listed below β¨argpis a pointer to a data structure that's specific toopπ«Ά
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. π
π the ops (each one has its own 2const page, go read those)
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_RWPROTECT(2const)UFFDIO_CONTINUE(2const)UFFDIO_POISON(2const)UFFDIO_SET_MODE(2const)
β RETURN VALUE
- on success?
0comes back, slay π - on error? you get
-1, anderrnogets set to tell you what went wrong π
π ERRORS
these are the general errors that can happen for, like, all of the operations above:
EFAULTβargpdoes not point to a valid memory address. nope, invalid memory, not today πEINVALβ (For all operations exceptUFFDIO_API.) The userfaultfd object has not yet been enabled (via theUFFDIO_APIoperation). bestie you gotta enable it first!!
πΈ STANDARDS
Linux. π periodt.
π¦ EXAMPLES
See userfaultfd(2). that's it, that's the example, go look π
π SEE ALSO
ioctl(2)mmap(2)userfaultfd(2)linux.git/Documentation/admin-guide/mm/userfaultfd.rst
and that's the whole page, bestie!! π«Ά this lil masterpiece lives in Linux man-pages 6.20, dated 2026-06-04, and it's literally the ioctl_userfaultfd(2) page in all her glory π ty for coming to my ted talk, ily, go resolve some page faults πβ¨π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2016, International Business Machines Corp
- Copyright 2016, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms