* 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. */
| 592 | * set to indicate the error. |
| 593 | */ |
| 594 | int 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 | } |
| 611 | RTM_EXPORT(fsync); |
| 612 | |
| 613 | /** |
nothing calls this directly
no test coverage detected