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, anderrnogets set to tell you which flavour of problem you're having. not the fun kind. π
π ERRORS π
EINVALβ Eitherargp->startor theargp->lenfields was not a multiple of the system page size; or theargp->lenfield 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 π
ioctl(2)ioctl_userfaultfd(2)UFFDIO_REGISTER(2const)userfaultfd(2)linux.git/Documentation/admin-guide/mm/userfaultfd.rst
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
- 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