process_vm_rw_single_vec(9)
πΈ process_vm_rw_single_vec(9) πΈ
okay so bestie, welcome to the Kernel API Manual π this one's a kernel-function page and it's lowkey iconic β it's all about moving pages in and out of another task's memory. no cap, kind of main character energy for a helper function. let's get into it π«Ά
β¨ NAME β¨
process_vm_rw_single_vec β read/write pages from task specified π
like, literally: you point at a task, and you read from it or write to it. that's the whole vibe.
π SYNOPSIS π
int process_vm_rw_single_vec (unsigned long addr , unsigned long len ,
struct iov_iter *iter , struct page **process_pages , struct mm_struct
*mm , struct task_struct *task , int vm_write );
seven arguments, one int coming back at you. she's thorough π
π¦ ARGUMENTS π¦
addrβ start memory address of target process. like, where in the other task's memory we're kicking things off β¨lenβ size of area to copy to/from. how much we're moving, fr fr πiterβ where to copy to/from locally. this is our side of the transaction, the local hangout spot πprocess_pagesβstruct pagesarea that can store at leastnr_pages_to_copystruct pagepointers. yes, "at least" β she needs room to breathe, don't skimp πmmβ mm for task. the memory map that goes with the task, obviously πtaskβ task to read/write from. our target. the one we're visiting πvm_writeβ0means copy from,1means copy to. and hey, the return info is tucked right in here too: Returns 0 on success or on failure error code. so like,0= slay, anything else = the error code, no cap π
heads up bestie:0and1are the only two vibes forvm_writeβ from, or to. pick your lane π
π§ SEE ALSO π§
kernel file ./mm/process_vm_access.c, plus the whole friend group:
all hanging out in the same file, iykyk π
and that's the page!! mwah π sourced straight from ./mm, dated October 2026 β go read the source, it 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