提交 fa0a16c8 编写于 作者: L liutingsong

修改小于0时的返回值

Signed-off-by: Nliutingsong <liutingsong@talkweb.com.cn>
上级 a3ff0ac7
......@@ -18,10 +18,14 @@ void *__mmap(void *start, size_t len, int prot, int flags, int fd, off_t off)
errno = EINVAL;
return MAP_FAILED;
}
if ((len >= PTRDIFF_MAX) || (len == 0)) {
if (len >= PTRDIFF_MAX) {
errno = ENOMEM;
return MAP_FAILED;
}
if (len == 0) {
errno = EINVAL;
return MAP_FAILED;
}
if (flags & MAP_FIXED) {
__vm_wait();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册