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

Function fsync

components/dfs/dfs_v2/src/dfs_posix.c:594–610  ·  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

592 * set to indicate the error.
593 */
594int fsync(int fildes)
595{
596 int ret;
597 struct dfs_file *file;
598
599 file = fd_get(fildes);
600 if (file == NULL)
601 {
602 rt_set_errno(-EBADF);
603
604 return -1;
605 }
606
607 ret = dfs_file_fsync(file);
608
609 return ret;
610}
611RTM_EXPORT(fsync);
612
613/**

Callers

nothing calls this directly

Calls 3

rt_set_errnoFunction · 0.85
dfs_file_fsyncFunction · 0.85
fd_getFunction · 0.70

Tested by

no test coverage detected