https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94268
--- Comment #3 from fdlbxtqi <euloanty at live dot com> --- I have found out the reason. It is because the buffer size is too small on the windows. BUFSIZ == 512 You need to set the value to 4096 at least. I think even 65536 is something should be done since the windows syscall is extremely expensive. I have tested with WriteFile, the maximum performance needs to set to 131072 buffer_size with my library. I think I can fix this bug easily.