mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-21 15:36:33 -05:00
Add a comment about reserving space in Windows.
This commit is contained in:
parent
4a41adc807
commit
be22724a95
1 changed files with 9 additions and 0 deletions
|
|
@ -869,6 +869,15 @@ int windows_ftruncate(int fd, off64_t off)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Windows effectively reserves space, but it doesn't initialize it.
|
||||
* It's then important to write starting from the begin to the end,
|
||||
* to avoid to have Windows to fill the holes writing zeros.
|
||||
*
|
||||
* See:
|
||||
* "Why does my single-byte write take forever?"
|
||||
* http://blogs.msdn.com/b/oldnewthing/archive/2011/09/22/10215053.aspx
|
||||
*/
|
||||
if (!SetEndOfFile(h)) {
|
||||
windows_errno(GetLastError());
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue