On Sat, Mar 7, 2020 at 9:36 AM Bruno Haible <br...@clisp.org> wrote: > > Dan Gohman wrote: > > That would fix the problem for systems that define O_RDONLY as Hurd does, > > while not breaking any known systems. > > > > It wouldn't be correct on a hypothetical system which defines the constants > > like this: > > > > #define O_WRONLY 0 > > #define O_RDONLY 1 > > #define O_RDWR 2 > > > > though I don't know of any platforms which do this. > > Reviewing the include files of the various platforms shows that > such a hypothetical system doesn't exist: > > O_RDONLY O_WRONLY O_RDWR > > AIX > Android > BeOS > Cygwin > FreeBSD > glibc/Linux > Haiku > HP-UX > Interix > IRIX > macOS > mingw, MSVC > Minix > MirBSD > musl > NetBSD > OpenBSD > OSF/1 > pips > Plan 9 > Solaris > 0 1 2 > > glibc/Hurd 1 2 3
Is there some reason that O_ACCMODE isn't the best choice here?