Fix: mmap len cannot be zero
This commit is contained in:
parent
32a1a53ee7
commit
212440dbb1
|
|
@ -54,6 +54,10 @@ fn do_sys_mmap(
|
|||
|
||||
check_option(&option)?;
|
||||
|
||||
if len == 0 {
|
||||
return_errno_with_message!(Errno::EINVAL, "mmap len cannot be zero");
|
||||
}
|
||||
|
||||
let len = len.align_up(PAGE_SIZE);
|
||||
|
||||
if offset % PAGE_SIZE != 0 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue