4 #include <string.h> //strdup
5 #include <stdio.h> //printf
6 #include <fcntl.h> //O_*
8 #include <sys/syscall.h>
13 return syscall(SYS_syncfs
, fd
);
16 int main(int argc
, char** argv
)
22 if(argc
> 1 && strcmp(argv
[1], "--help")==0)
25 "Usage: syncfs [<PATH>]\n"
26 "Request sync to the disk for the filesystem which <PATH> is on.\n"
27 "<PATH> is the current directory by default.\n");
43 fd
= open(path
, O_RDONLY
);
46 err(errno
, "%s: open", path
);