UFFDIO_CONTINUE(2const)

πŸ’– UFFDIO_CONTINUE(2const) πŸ’–

okay bestie, sit DOWN, because this is the UFFDIO_CONTINUE page from the Linux man-pages β€” section 2const, if you're keeping track β€” and it's genuinely so cute once it clicks. it's giving "resolve a minor page fault" energy and honestly? iconic.


🌸 NAME 🌸

UFFDIO_CONTINUE β€” resolve a minor page fault


πŸŽ€ LIBRARY πŸŽ€

Standard C library (libc, -lc)


✨ SYNOPSIS ✨

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

int ioctl(int fd, UFFDIO_CONTINUE, struct uffdio_continue *argp);

#include <linux/userfaultfd.h>

struct uffdio_continue {
    struct uffdio_range  range;
                     /* Range to install PTEs for and continue */
    __u64   mode;    /* Flags controlling the behavior of continue */
    __s64   mapped;  /* Number of bytes mapped, or negated error */
};

like look at that little struct. she's small but she's doing a LOT. 😌


πŸ¦‹ DESCRIPTION πŸ¦‹

so what are we actually doing here? resolving a minor page fault by installing page table entries for pages that already exist in the page cache. no new pages, no drama β€” the content is already chilling there, you're just hooking up the PTEs. periodt.

the following value may be bitwise ORed into mode to change the behavior of the UFFDIO_CONTINUE operation:

  • UFFDIO_CONTINUE_MODE_DONTWAKE β€” do not wake up the thread that's waiting for page-fault resolution. like, let her sleep. πŸ’€

<div></div>

now, the mapped field β€” this one is the kernel's little notes app, okay? the kernel uses it to hand you back the number of bytes that were actually mapped, or an error, in the exact same manner as UFFDIO_COPY. and if whatever comes back in mapped does not match the value you specified in range.len, the operation fails with the error EAGAIN. 🫠

real talk: mapped is output-only. it is not read by the UFFDIO_CONTINUE operation. you don't put anything in there, bestie, the kernel does. don't try it.

πŸ’… RETURN VALUE πŸ’…

this ioctl(2) operation returns 0 on success β€” and in that case, the entire area was mapped. slay. πŸŽ‰

on error, -1 is returned and errno is set to indicate the error.


😭 ERRORS 😭

  • EAGAIN β€” the number of bytes mapped (i.e., the value returned in the mapped field) does not equal the value that was specified in the range.len field.
  • EEXIST β€” one or more pages were already mapped in the given range. been there, done that, apparently. πŸ™ˆ
  • EFAULT β€” no existing page could be found in the page cache for the given range. she's not here, girl. πŸ’€
  • EINVAL β€” either range.start or range.len was not a multiple of the system page size; or range.len was zero; or the range specified was invalid.
  • EINVAL β€” an invalid bit was specified in the mode field.
  • ENOENT β€” the faulting process has changed its virtual memory layout simultaneously with an outstanding UFFDIO_CONTINUE operation. multitasking gone wrong fr fr.
  • ENOMEM β€” allocating memory needed to setup the page table mappings failed.
  • ESRCH β€” the faulting process has exited at the time of a UFFDIO_CONTINUE operation. she left the chat. 😭

🌈 STANDARDS 🌈

Linux.


πŸ‘‘ HISTORY πŸ‘‘

Linux 5.13.


πŸ“ EXAMPLES πŸ“

See userfaultfd(2).

(yes that's it. the examples live over there. go look, iykyk.) 🧚


⭐ SEE ALSO ⭐


and that's the whole page, bestie!! every flag, every errno, every field, all of it. you ate. πŸ’…βœ¨

this lil masterpiece lives in Linux man-pages 6.20, dated 2026-02-08 β€” mwah, kisses to whoever maintains it, no cap. 🫢🌸

πŸ“¦ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms