put_user(9)
β¨ 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 π
- Kernel file
./arch/x86/include/asm/uaccess.h get_user(9)__get_user(9)__put_user(9)
mwah π β source/version line is ./arch/x86/include/asm, dated October 2026, signing off as put_user(9) π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms