9.10 fcntl.h
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
Gnulib module: fcntl-h
Portability problems fixed by Gnulib:
- The type
pid_t
is not defined on some platforms:
MSVC 14.
- The type
mode_t
is not defined on some platforms:
MSVC 14.
- The type
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.
- ‘O_CLOEXEC’ is not defined on some platforms:
Mac OS X 10.6, FreeBSD 8.4, NetBSD 5.1, OpenBSD 4.9, Minix 3.1.8, AIX 7.1, HP-UX 11.31, Solaris 10, Cygwin 1.7.1, mingw, MSVC 14.
- ‘O_DIRECTORY’, ‘O_DSYNC’, ‘O_NOCTTY’,
‘O_NOFOLLOW’, ‘O_RSYNC’, ‘O_SYNC’,
and ‘O_TTY_INIT’ are not defined on some platforms.
When not otherwise defined, Gnulib defines these macros to 0,
which is generally safe.
- ‘O_NONBLOCK’ is not defined on some platforms. If the
‘nonblocking’ module is in use, gnulib guarantees a working
non-zero value; otherwise, the gnulib replacement is 0.
- ‘O_EXEC’ and ‘O_SEARCH’ are not defined on some platforms.
Gnulib defines these macros to ‘O_RDONLY’, which is typically 0.
The ‘O_PATH’ macro of GNU/Linux is not a suitable substitute, as
fchmod fails with ‘errno==EBADF’ when invoked on a file
descriptor that was opened with ‘O_PATH’.
- ‘O_ACCMODE’ is not defined on some platforms:
MSVC 14.
- The ‘O_ACCMODE’ mask mistakenly omits ‘O_SEARCH’ and
‘O_EXEC’ on some platforms:
Cygwin.
- ‘O_BINARY’, ‘O_TEXT’ (not specified by POSIX, but essential for
portability to native Windows platforms) are defined on some platforms but
not on others.
Gnulib defines these macros to 0 on GNU and other platforms that do not
distinguish between text and binary I/O.
- ‘O_CLOEXEC’, ‘O_NOFOLLOW’, and ‘O_TTY_INIT’
are defined to values that are too large for an
int
on some platforms:
AIX 7.1 with XL C 12.1.
- ‘O_DIRECT’, ‘O_IGNORE_CTTY’, ‘O_NDELAY’,
‘O_NOATIME’, ‘O_NOLINK’, ‘O_NOLINKS’, and
‘O_NOTRANS’ (not specified by POSIX) are defined
on some platforms but not on others.
When not otherwise defined, Gnulib defines these macros to 0,
which is generally safe.
- ‘FD_CLOEXEC’, ‘F_DUPFD’, and ‘F_GETFD’ are not defined
on some platforms:
mingw, MSVC 14.
- ‘F_DUPFD_CLOEXEC’ is not defined on some platforms:
Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 6.7, AIX 5.1, HP-UX 11, Solaris 11 2010-11, Cygwin 1.7.1, mingw, MSVC 14.
- ‘AT_FDCWD’, ‘AT_EACCESS’, ‘AT_SYMLINK_NOFOLLOW’,
‘AT_SYMLINK_FOLLOW’, and ‘AT_REMOVEDIR’
are not defined on many platforms:
glibc 2.3.6, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 6.7, AIX 5.1, HP-UX 11, Cygwin 1.5.x, mingw, MSVC 14.
- ‘AT_FDCWD’ is defined with a value too large for an
int
on some
platforms:
Solaris 11.3.
Portability problems not fixed by Gnulib:
- ‘O_PATH’ is not defined on some platforms:
glibc 2.13, macOS 13, FreeBSD 13.0, NetBSD 9.2, OpenBSD 7.1, Minix 3.3.0, AIX 7.3, HP-UX 11.31, Solaris 11.4, Cygwin 2.9, mingw, MSVC 14.
- ‘F_SETFD’, ‘F_GETFL’, ‘F_SETFL’, ‘F_GETLK’,
‘F_SETLK’, ‘F_SETLKW’, ‘F_GETOWN’, and ‘F_SETOWN’
are not defined on some platforms:
mingw, MSVC 14.
- ‘POSIX_FADV_DONTNEED’, ‘POSIX_FADV_NOREUSE’,
‘POSIX_FADV_NORMAL’, ‘POSIX_FADV_RANDOM’,
‘POSIX_FADV_SEQUENTIAL’, and ‘POSIX_FADV_WILLNEED’ are not
defined on some platforms.