Changes to msync(2)
- Return EBUSY if the region was wired by mlock(2) and MS_INVALIDATE is specified to msync(2). This is required by the Open Group Base Specifications Issue 6. - vm_map_sync() doesn't return KERN_FAILURE. Thus, msync(2) can't possibly return EIO. - The second major loop in vm_map_sync() handles sub maps. Thus, failing on sub maps in the first major loop isn't necessary.
This commit is contained in:
parent
614e1f02e8
commit
b7b7cd4421
@ -1985,10 +1985,10 @@ vm_map_sync(
|
||||
end = entry->end;
|
||||
}
|
||||
/*
|
||||
* Make a first pass to check for holes.
|
||||
* Make a first pass to check for user-wired memory and holes.
|
||||
*/
|
||||
for (current = entry; current->start < end; current = current->next) {
|
||||
if (current->eflags & MAP_ENTRY_IS_SUB_MAP) {
|
||||
if (invalidate && (current->eflags & MAP_ENTRY_USER_WIRED)) {
|
||||
vm_map_unlock_read(map);
|
||||
return (KERN_INVALID_ARGUMENT);
|
||||
}
|
||||
|
@ -558,8 +558,8 @@ msync(td, uap)
|
||||
return (0);
|
||||
case KERN_INVALID_ADDRESS:
|
||||
return (EINVAL); /* Sun returns ENOMEM? */
|
||||
case KERN_FAILURE:
|
||||
return (EIO);
|
||||
case KERN_INVALID_ARGUMENT:
|
||||
return (EBUSY);
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user