Squashed commit of the following:

fs: Add truncate() support for userfs
    fs/unionfs:  Add truncate() support to the unionfs
    fs/tmpfs:  Add ftruncate() support to tmpfs
    syscall/: Add system call support for ftruncate()
    net/route:  Adding ftruncate() support eliminates an issue in file-based routing table management.
    fs:  Add basic framework to support truncate() and ftruncate().  The infrastructure is complete.  Now, however, the actual implementation of ftruncate() will have to be done for each file system.
This commit is contained in:
Gregory Nutt
2018-01-03 16:03:56 -06:00
parent e59d747bf7
commit e4652bd3dc
25 changed files with 681 additions and 122 deletions
+1
View File
@@ -28,6 +28,7 @@
"fstat","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","FAR struct stat*"
"fstatfs","sys/statfs.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","FAR struct statfs*"
"fsync","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int"
"ftruncate","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int","off_t"
"get_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","int"
"get_errno_ptr","errno.h","defined(__DIRECT_ERRNO_ACCESS)","FAR int*"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*"
1 _exit unistd.h void int
28 fstat sys/stat.h CONFIG_NFILE_DESCRIPTORS > 0 int int
29 fstatfs sys/statfs.h CONFIG_NFILE_DESCRIPTORS > 0 int int
30 fsync unistd.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) int int
31 ftruncate unistd.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) int int
32 get_errno errno.h !defined(__DIRECT_ERRNO_ACCESS) int
33 get_errno_ptr errno.h defined(__DIRECT_ERRNO_ACCESS) FAR int*
34 getenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char* FAR const char*
+1
View File
@@ -269,6 +269,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(mount, 5, STUB_mount)
# endif
SYSCALL_LOOKUP(fsync, 1, STUB_fsync)
SYSCALL_LOOKUP(ftruncate, 2, STUB_ftruncate)
SYSCALL_LOOKUP(mkdir, 2, STUB_mkdir)
SYSCALL_LOOKUP(rename, 2, STUB_rename)
SYSCALL_LOOKUP(rmdir, 1, STUB_rmdir)
+1
View File
@@ -258,6 +258,7 @@ uintptr_t STUB_sched_getstreams(int nbr);
ssize_t sendfile(int outfd, int infd, FAR off_t *offset, size_t count);
uintptr_t STUB_fsync(int nbr, uintptr_t parm1);
uintptr_t STUB_ftruncate(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_mkdir(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_mount(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4, uintptr_t parm5);