Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/sys_process.c
| Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | proc_rwmem(struct proc *p, struct uio *uio) | ||||
| * If we are writing, then we request vm_fault() to create a private | * If we are writing, then we request vm_fault() to create a private | ||||
| * copy of each page. Since these copies will not be writeable by the | * copy of each page. Since these copies will not be writeable by the | ||||
| * process, we must explicity request that they be dirtied. | * process, we must explicity request that they be dirtied. | ||||
| */ | */ | ||||
| writing = uio->uio_rw == UIO_WRITE; | writing = uio->uio_rw == UIO_WRITE; | ||||
| reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; | reqprot = writing ? VM_PROT_COPY | VM_PROT_READ : VM_PROT_READ; | ||||
| fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; | fault_flags = writing ? VM_FAULT_DIRTY : VM_FAULT_NORMAL; | ||||
| if (writing) { | |||||
| error = priv_check_cred(p->p_ucred, PRIV_PROC_MEM_WRITE); | |||||
| if (error) | |||||
| return (error); | |||||
| } | |||||
| /* | /* | ||||
| * Only map in one page at a time. We don't have to, but it | * Only map in one page at a time. We don't have to, but it | ||||
| * makes things easier. This way is trivial - right? | * makes things easier. This way is trivial - right? | ||||
| */ | */ | ||||
| do { | do { | ||||
| vm_offset_t uva; | vm_offset_t uva; | ||||
| u_int len; | u_int len; | ||||
| vm_page_t m; | vm_page_t m; | ||||
| ▲ Show 20 Lines • Show All 1,321 Lines • Show Last 20 Lines | |||||