get_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_user(9) β€” Kernel API Manual πŸ’…

okay so bestie, welcome to the get_user(9) page β€” it's the Kernel API Manual entry for the tiny little macro that grabs one simple variable from user space. πŸ§šπŸ’–


✨ NAME ✨

get_user β€” get a simple variable from user space. 🫢

🌸 SYNOPSIS 🌸

get_user (x , ptr );

πŸŽ€ ARGUMENTS πŸŽ€

  • x β€” the variable where you store the result. πŸ’–
  • ptr β€” the source address, in user space. πŸ¦‹

πŸ¦‹ CONTEXT πŸ¦‹

User context only. 😌 This function may sleep if pagefaults are enabled. no cap, that's the context vibe check.

πŸ’œ DESCRIPTION πŸ’œ

This macro copies a single simple variable from user space to kernel space. ✨ It supports simple types like char and int, but not larger data types like structures or arrays. πŸ’€ So don't try to shove a whole struct through this thing, bestie β€” it's giving simple-variable-only energy.

ptr must have pointer-to-simple-variable type, and the result of dereferencing ptr must be assignable to x without a cast. periodt. πŸ’…

πŸ”₯ RETURN πŸ”₯

zero on success, or -EFAULT on error. 😭 On error, the variable x is set to zero β€” not me getting reset to zero energy, fr fr.

🌈 SEE ALSO 🌈

Kernel file ./arch/x86/include/asm/uaccess.h β€” plus __get_user(9), put_user(9), and __put_user(9). πŸ‘‘ Go read those too, iykyk.


mwah πŸ’‹ this page is from ./arch/x86/include/asm, dated October 2026, and it's literally the get_user(9) page. πŸŽ€πŸ’–

πŸ“¦ where this page comes from