fs/mmap: fix mmap() wrong errno
As posix spec, mmap() function shall fail with ENODEV if fd refers to a file whose type is not supported. Change to pass ltp open_posix test: testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
This commit is contained in:
parent
5176fb917a
commit
d892cda167
|
@ -269,8 +269,8 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
|
|||
|
||||
if (fd != -1 && fs_getfilep(fd, &filep) < 0)
|
||||
{
|
||||
ferr("ERROR: Invalid file descriptor, fd=%d\n", fd);
|
||||
ret = -EBADF;
|
||||
ferr("ERROR: fd:%d referred file whose type is not supported\n", fd);
|
||||
ret = -ENODEV;
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue