Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

fcntl (nr 72)

Linux Signature

int fcntl(int fd, int cmd, ... /* arg */);

Description

Performs operations on file descriptors. Only fd-level flag operations are supported.

Current Implementation

CommandValueBehaviour
F_GETFD1Returns the fd flags (currently only FD_CLOEXEC)
F_SETFD2Sets the fd flags to arg
F_GETFL3Returns 0 (no file status flags tracked)
OtherReturns -EINVAL

Source: osl/src/syscalls/fs.rssys_fcntl

Errors

ErrnoCondition
-EBADF (-9)fd is not a valid open fd
-EINVAL (-22)Unknown cmd