![]() |
![]() |
![]() |
Synchronize the file state
#include <unistd.h> int fsync( int filedes );
libc
The fsync() function forces all queued I/O operations for the file specified by the filedes file descriptor to finish, synchronizing the file's state.
Although similar to fdatasync(), fsync() also guarantees the integrity of file information such as access and modification times.
0 for success, or -1 if an error occurs (errno is set).
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
aio_fsync(), close(), fcntl(), fdatasync(), open(), read(), sync(), write()
![]() |
![]() |
![]() |