FreeBSD/sys/kern/subr_uio.c
/*
 * Map some anonymous memory in user space of size sz, rounded up to the page
 * boundary.
 */
Map some anonymous memory in user space of size sz, rounded up to the page
boundary.
Map some anonymous memory in user space of size sz rounded up to the page boundary .
int
copyout_map(struct thread *td, vm_offset_t *addr, size_t sz)
{
	struct vmspace *vms;
	int error;
	vm_size_t size;
	vms = td->td_proc->p_vmspace;
	*addr = round_page((vm_offset_t)vms->vm_daddr +
	    lim_max(td, RLIMIT_DATA));
	size = (vm_size_t)round_page(sz);
	error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE,
	    VM_PROT_ALL, MAP_PRIVATE | MAP_ANON, OBJT_DEFAULT, NULL, 0);
	return (error);
}
int copyout_map ( struct thread * td , vm_offset_t * addr , size_t sz ) { struct vmspace * vms ; int error ; vm_size_t size ; vms = td -> td_proc -> p_vmspace ; * addr = round_page ( ( vm_offset_t ) vms -> vm_daddr + lim_max ( td , RLIMIT_DATA ) ) ; size = ( vm_size_t ) round_page ( sz ) ; error = vm_mmap ( & vms -> vm_map , addr , size , VM_PROT_READ | VM_PROT_WRITE , VM_PROT_ALL , MAP_PRIVATE | MAP_ANON , OBJT_DEFAULT , NULL , 0 ) ; return ( error ) ; }
Map some anonymous memory in user space of size sz, rounded up to the page
 boundary.
Map some anonymous memory in user space of size sz rounded up to the page boundary .
/*
	 * Map somewhere after heap in process memory.
	 */ /* round size up to page boundary */