MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / fsync

Function fsync

components/dfs/dfs_v1/src/dfs_posix.c:449–465  ·  view source on GitHub ↗

* this function is a POSIX compliant version, which shall request that all data * for the open file descriptor named by fildes is to be transferred to the storage * device associated with the file described by fildes. * * @param fildes the file description * * @return 0 on successful completion. Otherwise, -1 shall be returned and errno * set to indicate the error. */

Source from the content-addressed store, hash-verified

447 * set to indicate the error.
448 */
449int fsync(int fildes)
450{
451 int ret;
452 struct dfs_file *d;
453
454 /* get the fd */
455 d = fd_get(fildes);
456 if (d == NULL)
457 {
458 rt_set_errno(-EBADF);
459 return -1;
460 }
461
462 ret = dfs_file_flush(d);
463
464 return ret;
465}
466RTM_EXPORT(fsync);
467
468/**

Callers 6

sys_fsyncFunction · 0.50
aio_fync_workFunction · 0.50
_sys_writeFunction · 0.50
_sys_ensureFunction · 0.50
capture_then_playFunction · 0.50

Calls 3

rt_set_errnoFunction · 0.85
fd_getFunction · 0.70
dfs_file_flushFunction · 0.70

Tested by

no test coverage detected