We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent9e231ba commit6b34711Copy full SHA for 6b34711
src/tools/fsync/test_fsync.c
@@ -29,6 +29,8 @@
29
#endif
30
31
32
+#defineWAL_FILE_SIZE (16 * 1024 * 1024)
33
+
34
voiddie(char*str);
35
voidprint_elapse(structtimevalstart_t,structtimevalelapse_t);
36
@@ -40,7 +42,7 @@ main(int argc, char *argv[])
40
42
inttmpfile,
41
43
i,
44
loops=1000;
-char*strout= (char*)malloc(65536);
45
+char*strout= (char*)malloc(WAL_FILE_SIZE);
46
char*filename=FSYNC_FILENAME;
47
48
if (argc>2&&strcmp(argv[1],"-f")==0)
@@ -53,12 +55,12 @@ main(int argc, char *argv[])
53
55
if (argc>1)
54
56
loops=atoi(argv[1]);
57
-for (i=0;i<65536;i++)
58
+for (i=0;i<WAL_FILE_SIZE;i++)
59
strout[i]='a';
60
61
if ((tmpfile=open(FSYNC_FILENAME,O_RDWR |O_CREAT,S_IRUSR |S_IWUSR))==-1)
62
die("can't open /var/tmp/test_fsync.out");
-write(tmpfile,strout,65536);
63
+write(tmpfile,strout,WAL_FILE_SIZE);
64
fsync(tmpfile);/* fsync so later fsync's don't have to do
65
* it */
66
close(tmpfile);