lib: c: io: munmap now unmaps and unreserves a region of memory
This commit is contained in:
@@ -25,7 +25,17 @@ int munmap(void *addr, size_t length)
|
|||||||
|
|
||||||
status = address_space_unmap(address_space, (virt_addr_t)addr, length);
|
status = address_space_unmap(address_space, (virt_addr_t)addr, length);
|
||||||
|
|
||||||
|
if (status != KERN_OK) {
|
||||||
|
kern_handle_close(address_space);
|
||||||
|
return __set_errno(__errno_from_kern_status(status));
|
||||||
|
}
|
||||||
|
|
||||||
|
status = address_space_release(
|
||||||
|
address_space,
|
||||||
|
(virt_addr_t)addr,
|
||||||
|
length);
|
||||||
kern_handle_close(address_space);
|
kern_handle_close(address_space);
|
||||||
|
|
||||||
if (status != KERN_OK) {
|
if (status != KERN_OK) {
|
||||||
return __set_errno(__errno_from_kern_status(status));
|
return __set_errno(__errno_from_kern_status(status));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user