/* 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. */
int fsync(int fildes)
/* 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. */
int fsync(int fildes)
{
    int ret;
    struct dfs_file *file;
    file = fd_get(fildes);
    if (file == NULL)
    {
        rt_set_errno(-EBADF);
        return -1;
    }
    ret = dfs_file_fsync(file);
    return ret;
}