#include "fsync.h"
#include <stdlib.h>
#include "../error/error.h"
#include "../error/error.c"
Functions | |
NPS_FSYNC_LKG int | nps_fsync (const char *path, nps_error_t *error) |
NPS_FSYNC_LKG int nps_fsync | ( | const char * | path, | |
nps_error_t * | error | |||
) |
nps_fync is similar to sync, but acts on file names rather than file descriptors. It uses standard NPSML error handling.
The mechanism under the hood is to open the file for reading. As long as the file was closed before this call to fopen, POSIX close->open consistency guarantees the file buffer is flushed to storage.