SHA256
1
0
forked from pool/sqlite3
sqlite3/sqlite-check_fsync_dir.c

26 lines
392 B
C

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main (int argc, char **argv)
{
int fd, status;
fd = open(".", O_RDONLY);
if (fd < 0) {
perror("open");
exit(1);
}
status = fsync(fd);
if (status != 0) {
perror("fsync");
exit(2);
}
close(fd);
printf("OK\n");
exit(0);
}