1 #include "git-compat-util.h"
10 #define FILENAME "stat-test.tmp"
12 int main(int argc
, char**argv
)
16 memset(&st1
, 0, sizeof(st1
));
17 memset(&st2
, 0, sizeof(st2
));
20 int fd
= open(FILENAME
, O_CREAT
|O_RDWR
|O_TRUNC
, S_IRWXU
);
23 perror("Cannot open " FILENAME
);
26 Sleep(1000); /* It is IMPORTANT! */
27 write(fd
, "test\n", 5);
31 if (st1
.st_mtime
== st2
.st_mtime
)
32 printf("fstat is OK\n");
34 printf("fstat is broken\n");