put_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ put_user(9) β€” Kernel API Manual ✨

πŸŽ€ NAME πŸŽ€

put_user β€” write a simple value into user space. πŸ’–

🌸 SYNOPSIS 🌸

put_user (x , ptr );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • x β€” the value to copy to user space. πŸ’«
  • ptr β€” destination address, in user space. 🎯

πŸ‘‘ CONTEXT πŸ‘‘

Context check, bestie: user context only. This function may sleep if pagefaults are enabled. 😴

πŸ’… DESCRIPTION πŸ’…

Okay so this macro copies a single simple value from kernel space to user space. It supports simple types like char and int, but not larger data types like structures or arrays. No cap.

ptr must have pointer-to-simple-variable type, and x must be assignable to the result of dereferencing ptr. That's the type vibe check, bestie. ✨

πŸ”₯ RETURN πŸ”₯

zero on success, or -EFAULT on error. Slay on zero, cry on -EFAULT. 😭

🌈 SEE ALSO 🌈


mwah πŸ’‹ β€” source/version line is ./arch/x86/include/asm, dated October 2026, signing off as put_user(9) 🫢✨

πŸ“¦ where this page comes from