nuttx/fs
fangxinyong 5176fb917a fs/vfs: ftruncate produce EINVAL if fd is not open for writing
As posix spec, ftruncate should produce EBADF or EINVAL error,
if the file descriptor fd is not open for writing.

Change the behavior to be similar to Linux and pass ltp open_posix test:
testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c

https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html
https://man7.org/linux/man-pages/man2/ftruncate.2.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:57:28 -07:00
..
aio fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
binfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
cromfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
driver cmake/build: fix build break on cmake 2023-07-25 15:00:10 +02:00
fat Kconfig: Simplify the conditional default statement 2023-07-16 14:39:20 -03:00
hostfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
inode fs/pseudofile: config pseudofile feature 2023-07-31 22:22:58 -07:00
littlefs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
mmap fs/mmap: fix wrong return value check 2023-07-28 08:05:39 -07:00
mount build: add initial cmake build system 2023-07-08 13:50:48 +08:00
mqueue fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
nfs fs/nfs: fix coding style issue 2023-07-31 21:41:30 -07:00
nxffs Fix nuttx coding style 2023-07-11 23:32:17 +08:00
partition TXTABLE: Support backup table 2023-07-29 20:27:10 -07:00
procfs fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
romfs fs/romfs: Fix FIOC_FILEPATH for dup'ed file 2023-08-02 06:12:25 -07:00
rpmsgfs cmake/build: fix build break on cmake 2023-07-25 15:00:10 +02:00
semaphore fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
shm sim/posix_test: fix shm_open() return file descriptor associated with FD_CLOEXEC 2023-07-11 13:30:34 +08:00
smartfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
socket build: add initial cmake build system 2023-07-08 13:50:48 +08:00
spiffs Fix nuttx coding style 2023-07-11 23:32:17 +08:00
tmpfs fs/tmpfs: add munmap interface for tmpfs file map 2023-07-28 08:05:39 -07:00
unionfs fs/unionfs: Remove unionfs_mount function 2023-07-30 18:51:26 -03:00
userfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
vfs fs/vfs: ftruncate produce EINVAL if fd is not open for writing 2023-08-02 22:57:28 -07:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs_initialize.c fs: Flush the file system cache in BOARDIOC_POWEROFF too 2023-04-21 20:37:59 +03:00
Kconfig fs/pseudofile: config pseudofile feature 2023-07-31 22:22:58 -07:00
Makefile Minor style clean up 2023-01-28 19:53:20 +02:00