F_GETFL, F_SETFL
get/set file status flags
- Provided by: manpages-dev (Version: 6.17-1)
- Source: manpages
- Report a bug
get/set file status flags
Standard C library (libc, -lc)
#include <fcntl.h>
int fcntl(int fd, F_GETFL); int fcntl(int fd, F_SETFL, int arg);
Each open file description has certain associated status flags, initialized by open(2) and possibly modified by fcntl(2). Duplicated file descriptors (made with dup(2), F_DUPFD(2const), fork(2), etc.) refer to the same open file description, and thus share the same file status flags.
The file status flags and their semantics are described in open(2).
On error, -1 is returned, and errno is set to indicate the error.
See fcntl(2).
POSIX.1-2024.
SVr4, 4.3BSD, POSIX.1-1988.
It is not possible to use F_SETFL to change the state of the O_DSYNC and O_SYNC flags. Attempts to change the state of these flags are silently ignored.