__put_user(9)
πΈ __put_user(9) πΈ
hey bestie, welcome to the Kernel API Manual β todayβs main character is __put_user(9), and she is lowkey here to write one simple value into user space with less checking. no cap. π«Ά
β¨ NAME β¨
__put_user β write a simple value into user space, with less checking. π
π SYNOPSIS π
__put_user (x , ptr );
π¦ ARGUMENTS π¦
xβ the value to copy to user space. literally the thing being sent over. πptrβ the destination address, in user space. thatβs wherexis going, bestie. π
π CONTEXT π
user context only, okay? π this function may sleep if pagefaults are enabled β so donβt be weird about it. π΄
π 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 β so leave your big complicated faves at home, this is a one-value situation. β¨
ptr must have pointer-to-simple-variable type, and x must be assignable to the result of dereferencing ptr. thatβs the vibe check for the types, fr fr. π§
π¨ caller must check the pointer with access_ok before calling this function. not optional, bestie β do the check first. π
π₯ RETURN π₯
zero on success, or -EFAULT on error. thatβs it, thatβs the whole report card. π
π SEE ALSO π
- Kernel file
./arch/x86/include/asm/uaccess.h get_user(9)__get_user(9)put_user(9)
catch u later, mwah π
β this cutie came from ./arch/x86/include/asm, October 2026, and yes she ate. ππ
π¦ 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