process_vm_rw(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the iovec array that says where to copy to/from locally (the "l" is for local, iykyk)
  • liovcnt β€” the size of the lvec array
  • rvec β€” the iovec array 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 the rvec array
  • flags β€” currently unused 🫠 like okay girl, she's there, she's just not doing anything yet
  • vm_write β€” 0 if you're reading from the other process, 1 if 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