POSIX specification:
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fcntl.h.html
Portability problems fixed by Gnulib:
pid_t is not defined on some platforms:
MSVC 14.
mode_t is not defined on some platforms:
MSVC 14.
off64_t is not defined on some platforms:
macOS 14, FreeBSD 10.4, NetBSD 10.0, OpenBSD 7.5, MSVC 14, Cygwin, Haiku, Minix 3.3.
Note: ‘O_EXEC’ is not suitable for opening a file descriptor
that you want to use with fchmod later, because
musl libc defines ‘O_EXEC’ to O_PATH and
Linux fchmod fails with error EBADF when given such a file
descriptor.
O_PATH on some platforms:
musl libc.
int on some platforms:
AIX 7.1 with XL C 12.1.
int on some
platforms:
Solaris 11.3.
Portability problems not fixed by Gnulib:
fcntl-h module defines ‘HAVE_WORKING_O_NOATIME’ to 1
on platforms where ‘O_NOATIME’ is known to work, and to 0 otherwise;
and similarly for ‘HAVE_WORKING_O_NOFOLLOW’ and ‘O_NOFOLLOW’:
Mac OS X 10.3.
O_CLOFORK,
FD_CLOFORK and F_DUPFD_CLOFORK,
they are not defined on most platforms:
glibc 2.41, musl libc, macOS 15.5, FreeBSD 14.2, NetBSD 10.1, OpenBSD 7.7, Minix 3.3.0, AIX 7.3, Solaris 11.3, Cygwin 3.6.2, mingw, MSVC 14.