I prefer to fix this using "write_all" which specifically doesn't have this problem.    Or at least put in a snarky reference to glibc+gcc braindamage a-la https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 :)