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

Function sys_fsync

components/lwp/lwp_syscall.c:9020–9026  ·  view source on GitHub ↗

* @brief Flush the file descriptors' data to disk. * * This function flushes all modified data of the file associated with the specified * file descriptor to disk, ensuring that any changes made to the file are committed * to permanent storage. * * @param[in] fd The file descriptor associated with the file to be flushed. It should * refer to an open file. * * @return sysret_

Source from the content-addressed store, hash-verified

9018 * To flush both data and metadata, `fdatasync` can be used.
9019 */
9020sysret_t sys_fsync(int fd)
9021{
9022 int res = fsync(fd);
9023 if (res < 0)
9024 res = rt_get_errno();
9025 return res;
9026}
9027
9028/**
9029 * @brief Open a message queue.

Callers

nothing calls this directly

Calls 2

rt_get_errnoFunction · 0.85
fsyncFunction · 0.50

Tested by

no test coverage detected