Actually, on a bit more reflection, perhaps the best way forward is to work out a better method of implementing the shm() stuff puerly out of uvm facilities (with minimal, less than is there now, extra data structs) - so shmctl(SHM_LOCK) is just mlock() but perhaps with an extra parameter to the underying function which does the work to indicate the semantics.
Anyway, later... kre
