UFFDIO_UNREGISTER(2const)

✨ UFFDIO_UNREGISTER ✨

okay bestie, so this one's a <purple>2const</purple> page from the <cyan>Linux man-pages 6.20</cyan> era, and it's literally the un-register button for your userfaultfd ranges πŸ’… she's short, she's sweet, she does exactly one thing and she does it flawlessly, periodt.


πŸŽ€ NAME πŸŽ€

UFFDIO_UNREGISTER β€” bestie, this is the one that <hotpink>unregisters a memory address range from userfaultfd</hotpink>. That's it. That's the whole job. Iconic behaviour honestly 🫢

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” yeah she lives in libc, no cap 🧚

🌸 SYNOPSIS 🌸

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

int ioctl(int fd, UFFDIO_UNREGISTER, const struct uffdio_range *argp);

yes the include comment is part of the deal, do not skip it, I am watching πŸ‘€

πŸ’– DESCRIPTION πŸ’–

So like. When you've got a memory address range registered with userfaultfd (you were being so main character about it, we love that for you) and you want to take it back off the list, you hit it with UFFDIO_UNREGISTER. Just hand it the range and it's unregistered, bye felicia πŸ’¨

BUT. The pages in that range have to be "compatible". Which is a whole vibe check thing β€” go read UFFDIO_REGISTER(2const) for what counts as compatible, because ngl it matters and I'm not about to invent rules that aren't on the page fr fr.

⚠️ incompatible pages in the range = it's giving EINVAL. just so you know.

πŸ”₯ RETURN VALUE πŸ”₯

  • success β†’ returns 0. slay. everything worked, go take a selfie πŸ“Έ
  • error β†’ returns -1, and errno gets set to tell you which flavour of problem you're having. not the fun kind. 😭

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” Either argp->start or the argp->len fields was not a multiple of the system page size; or the argp->len field was zero; or these fields were otherwise invalid. (page size math bestie, she's not optional. and zero? bestie. zero. 😭)
  • EINVAL β€” There as an incompatible mapping in the specified address range. (yes, "There as an incompatible mapping" β€” that's the original's typo and I am NOT fixing it, we preserve the lore πŸ’€)
  • EINVAL β€” There was no mapping in the specified address range.
three separate EINVALs. three separate reasons. the kernel is not subtle and honestly? respect πŸ‘‘

πŸ“ STANDARDS πŸ“

Linux. 🌈 that's it, that's the standard.

πŸ•°οΈ HISTORY πŸ•°οΈ

Linux 4.3 β€” she's been around a minute, a real vintage queen πŸŽ€

πŸ“ EXAMPLES πŸ“

See userfaultfd(2). (the examples live over there, I'm not duplicating them, go look, they're cute 🫢)

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie β€” short king energy but every detail intact πŸ’–

this was brought to you by Linux man-pages 6.20, dated 2026-02-08, filed under UFFDIO_UNREGISTER(2const). go unregister something responsibly βœ¨πŸ’…πŸ¦‹

πŸ“¦ 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