https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66936
--- Comment #8 from Keith Marshall <keith.marshall at mailinator dot com> --- (In reply to kargl from comment #7) > So add > > #define S_IRWXG 0 > #define S_IRWXO 0 > > to the header file wherever mingw defines the available mask bits > for umask(3). The bug is clearly in mingw were it gratuitously maps > umask() to _umask() without properly adding the mappings for the > mode_t argument bits of umask(3). Absolutely not! Those bits are utterly irrelevant for the windows (MinGW) platform; to add them would be do nothing more than create confusion. The mask bits for umask(), on the windows platform are S_IREAD | S_IWRITE; those are the only mask bits YOUR code should be passing to non-POSIX umask(5axxx3be.aspx). This is NOT a MinGW bug; it's a GCC bug, and that's where it should be fixed. Until you do fix it, I have my work-around, (which I'm perfectly willing to publish in MinGW forked source for GCC, prominently commented as a ghastly hack to circumvent a gross upstream GCC bug).