process_vm_rw(9)
π process_vm_rw β the kernel API manual, bestie edition β¨
Okay so real talk, this is process_vm_rw(9) from the Kernel API Manual β yes, the section 9 one, the kernel-internals one, not the lil user-space one. Sit down, grab a strawberry drink π, we're gonna go through this together.
β¨ NAME β¨
process_vm_rw β literally just: check your iovecs before you go calling the core routine. That's the whole vibe. It's the bouncer at the club, not the DJ π
πΈ SYNOPSIS πΈ
ssize_t process_vm_rw (pid_t pid , const struct iovec __user *lvec ,
unsigned long liovcnt , const struct iovec __user *rvec , unsigned long
riovcnt , unsigned long flags , int vm_write );
Like, look at all those params. She's got range, she's got presence, she's giving "seven arguments and not one of them is optional" energy π
π¦ ARGUMENTS π¦
pidβ the PID of the process you're reading from / writing to. Your target, your main character πlvecβ theiovecarray that says where to copy to/from locally (the "l" is for local, iykyk)liovcntβ the size of thelvecarrayrvecβ theiovecarray that says where to copy to/from in the other process (the "r" is for remote, we love a naming convention that actually eats)riovcntβ the size of thervecarrayflagsβ currently unused π« like okay girl, she's there, she's just not doing anything yetvm_writeβ0if you're reading from the other process,1if you're writing to the other process. Binary queen, no in-between
π DESCRIPTION π
So what does she actually do? She returns the number of bytes read/written, or an error code. That's it, that's the tweet β¨
And heads up bestie, no cap: she may return fewer bytes than you expected if an error happens during the copying process. So don't be out here assuming you got the whole thing β check your return value, fr fr π
Not me reminding you again: partial copies are a whole thing here. If an error pops up mid-copy, you get less than you asked for. Not zero necessarily, just less. Vibe check your byte counts π§
π SEE ALSO π
Kernel file ./mm/process_vm_access.c, plus the whole friend group:
Go say hi to them, they're iconic π
That's the whole page, you ate that π«Ά Sourced from ./mm, dated October 2026 β mwah, see you in the next manpage bestie π
β¨
π¦ 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