Skip to content

Commit 6b34711

Browse files
committed
Allocate 16mb file for testing.
1 parent 9e231ba commit 6b34711

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/tools/fsync/test_fsync.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#endif
3030
#endif
3131

32+
#define WAL_FILE_SIZE (16 * 1024 * 1024)
33+
3234
void die(char *str);
3335
void print_elapse(struct timeval start_t, struct timeval elapse_t);
3436

@@ -40,7 +42,7 @@ main(int argc, char *argv[])
4042
int tmpfile,
4143
i,
4244
loops=1000;
43-
char *strout = (char *) malloc(65536);
45+
char *strout = (char *) malloc(WAL_FILE_SIZE);
4446
char *filename = FSYNC_FILENAME;
4547

4648
if (argc > 2 && strcmp(argv[1],"-f") == 0)
@@ -53,12 +55,12 @@ main(int argc, char *argv[])
5355
if (argc > 1)
5456
loops = atoi(argv[1]);
5557

56-
for (i = 0; i < 65536; i++)
58+
for (i = 0; i < WAL_FILE_SIZE; i++)
5759
strout[i] = 'a';
5860

5961
if ((tmpfile = open(FSYNC_FILENAME, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR)) == -1)
6062
die("can't open /var/tmp/test_fsync.out");
61-
write(tmpfile, strout, 65536);
63+
write(tmpfile, strout, WAL_FILE_SIZE);
6264
fsync(tmpfile); /* fsync so later fsync's don't have to do
6365
* it */
6466
close(tmpfile);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy