copy_remote_vm_str(9)
π copy_remote_vm_str(9) β from the Kernel API Manual, bestie β¨
Okay so picture this: it's a (9) page straight out of the Kernel API Manual, and it's all about yoinking a string out of somebody else's address space. Yes, another process. Yes, that's the whole vibe. π«Ά
πΈ NAME πΈ
copy_remote_vm_str β literally just copy a string from another process's address space. That's it. That's the function. π
β¨ SYNOPSIS β¨
int copy_remote_vm_str (struct task_struct *tsk , unsigned long addr ,
void *buf , int len , unsigned int gup_flags );
Five arguments, one int coming back at you. Iconic. π
π ARGUMENTS π
tskβ the task whose address space we're snooping through. It's giving "the target address space" main character energy.addrβ where you start reading from. The starting line. πbufβ the destination buffer, aka where the string lands. Your emotional support buffer.lenβ how many bytes you're copying. Count 'em. π’gup_flagsβ flags that modify lookup behaviour. And here's the tea: they're unused π. Present, accounted for, not doing anything.
π¦ DESCRIPTION π¦
Okay so the one thing you absolutely cannot forget: the caller must hold a reference on mm. That's not a suggestion, that's the rule. Hold the reference. No cap. π₯
π RETURN π
What you get back is the number of bytes copied from addr (the source) over to buf (the destination) β and ngl, that count does not include the trailing NUL.
Also, bestie, a guarantee: it always leaves you with a NUL-terminated buffer. Always. π
But if anything goes sideways on any error? You get -EFAULT. That's it. That's the whole error story. π
β SEE ALSO β
Kernel file ./mm/nommu.c, plus these besties:
vmalloc_node(9)vzalloc_node(9)vmalloc_32(9)vmalloc_32_user(9)access_remote_vm(9)nommu_shrink_inode_mappings(9)
iykyk π
π§ Friendly little reminder from me to you: hold that mm reference. Seriously. π
Sign-off time, bestie π β this page lives in the source directory ./mm, it's dated October 2026, and it's filed under copy_remote_vm_str(9) in the Kernel API Manual. Slay, go copy some strings. π
β¨
π¦ 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