Skip to content

Commit 87469c4

Browse files
committed
lets zerofill files by hand on windows in fio_send_file_write
1 parent a04f00a commit 87469c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/utils/file.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2717,11 +2717,21 @@ fio_send_file_write(FILE* out, send_file_state* st, char *buf, size_t len)
27172717
if (len == 0)
27182718
return true;
27192719

2720+
#ifndef WIN32
27202721
if (st->read_size > st->write_size &&
27212722
fseeko(out, st->read_size, SEEK_SET) != 0)
27222723
{
27232724
return false;
27242725
}
2726+
#else
2727+
while (st->read_size > st->write_size)
2728+
{
2729+
size_t wr = st->read_size - st->write_size;
2730+
wr = Min(wr, sizeof(zerobuf));
2731+
fwrite(zerobuf, 1, wr, out);
2732+
st->write_size += wr;
2733+
}
2734+
#endif
27252735

27262736
if (fwrite(buf, 1, len, out) != len)
27272737
{

0 commit comments

Comments
 (0)