lib: os: fdtable: add support for fsync
Add support for fsync in existing posix ioctl call Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
This commit is contained in:
parent
42036cdbca
commit
65ad32b3ca
3 changed files with 6 additions and 0 deletions
|
@ -237,6 +237,7 @@ int close(int file);
|
|||
ssize_t write(int file, const void *buffer, size_t count);
|
||||
ssize_t read(int file, void *buffer, size_t count);
|
||||
off_t lseek(int file, off_t offset, int whence);
|
||||
int fsync(int fd);
|
||||
|
||||
/* File System related operations */
|
||||
int rename(const char *old, const char *newp);
|
||||
|
|
|
@ -362,6 +362,7 @@ int fsync(int fd)
|
|||
|
||||
return z_fdtable_call_ioctl(fdtable[fd].vtable, fdtable[fd].obj, ZFD_IOCTL_FSYNC);
|
||||
}
|
||||
FUNC_ALIAS(fsync, _fsync, int);
|
||||
|
||||
off_t lseek(int fd, off_t offset, int whence)
|
||||
{
|
||||
|
|
|
@ -144,6 +144,10 @@ static int fs_ioctl_vmeth(void *obj, unsigned int request, va_list args)
|
|||
struct posix_fs_desc *ptr = obj;
|
||||
|
||||
switch (request) {
|
||||
case ZFD_IOCTL_FSYNC: {
|
||||
rc = fs_sync(&ptr->file);
|
||||
break;
|
||||
}
|
||||
case ZFD_IOCTL_LSEEK: {
|
||||
off_t offset;
|
||||
int whence;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue