File descriptor

The following lists typical operations on file descriptors on modern Unix-like systems.

The fcntl() function is used to perform various operations on a file descriptor, depending on the command argument passed to it.

A series of new operations has been added to many modern Unix-like systems, as well as numerous C libraries, to be standardized in a future version of POSIX.

[7] The at suffix signifies that the function takes an additional first argument supplying a file descriptor from which relative paths are resolved, the forms lacking the at suffix thus becoming equivalent to passing a file descriptor corresponding to the current working directory.

They can be passed between processes across Unix domain sockets using the sendmsg() system call.

File descriptors for a single process, file table and inode table. Note that multiple file descriptors can refer to the same file table entry (e.g., as a result of the dup system call [ 3 ] : 104 ) and that multiple file table entries can in turn refer to the same inode (if it has been opened multiple times; the table is still simplified because it represents inodes by file names, even though an inode can have multiple names ). File descriptor 3 does not refer to anything in the file table, signifying that it has been closed.