mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-05 20:35:08 +02:00
vfs,fat: add fsync to VFS interface, implement it for fatfs
This commit is contained in:
@@ -534,3 +534,17 @@ int ioctl(int fd, int cmd, ...)
|
||||
va_end(args);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int fsync(int fd)
|
||||
{
|
||||
const vfs_entry_t* vfs = get_vfs_for_fd(fd);
|
||||
struct _reent* r = __getreent();
|
||||
if (vfs == NULL) {
|
||||
__errno_r(r) = EBADF;
|
||||
return -1;
|
||||
}
|
||||
int local_fd = translate_fd(vfs, fd);
|
||||
int ret;
|
||||
CHECK_AND_CALL(ret, r, vfs, fsync, local_fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user