https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81751
--- Comment #3 from Volker Wehrs <bugzilla.volker at kabelmail dot de> --- Why is sync() (alias fflush()) called in sys_open(FILE*,...) at all? 1. It is not called in sys_open(int,...) 2. Both sys_open() functions are called in the constructor of stdio_filebuf _only_. So, as __basic_file seem to be intended as an internal class, maybe the call to sync() can completely be omitted as there definitively is no open file.