Use vm_mmap_to_errno().

Submitted by:	kib
This commit is contained in:
jhb 2011-12-15 15:17:19 +00:00
parent c43116e67e
commit 6d2ab3b363

View File

@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
@ -790,15 +791,7 @@ shm_map(struct file *fp, size_t size, off_t offset, void **memp)
shmfd->shm_kmappings--;
VM_OBJECT_UNLOCK(obj);
switch (rv) {
case KERN_INVALID_ADDRESS:
case KERN_NO_SPACE:
return (ENOMEM);
case KERN_PROTECTION_FAILURE:
return (EACCES);
default:
return (EINVAL);
}
return (vm_mmap_to_errno(rv));
}
/*