Subject: uvm_map and overwriting
To: None <tech-kern@netbsd.org>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 04/19/2003 12:53:57
Hello everybody

How can I use uvm_map() to map a file on an adress range where there is
already something mapped?

I tried this:

error = uvm_map(&l->l_proc->p_vmspace->vm_map,
    (vaddr_t *)&va, size, uobj, offset, 0,
    UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, 
    UVM_INH_COPY, UVM_ADV_NORMAL,
    UVM_FLAG_COPYONW | UVM_FLAG_FIXED));

But if there is already something at address va, I get ENOMEM.
I tried UVM_MAP_OVERLAY (which is not documented beyond its name, the
name looks nice...), I get the same result. 

-- 
Emmanuel Dreyfus
manu@netbsd.org