FD(4) BSD Programmer's Manual FD(4)
f
\bfd
\bd, s
\bst
\btd
\bdi
\bin
\bn, s
\bst
\btd
\bdo
\bou
\but
\bt, s
\bst
\btd
\bde
\ber
\brr
\br - file descriptor files
D
\bDE
\bES
\bSC
\bCR
\bRI
\bIP
\bPT
\bTI
\bIO
\bON
\bN
The files _
\b/_
\bd_
\be_
\bv_
\b/_
\bf_
\bd_
\b/_
\b0 through _
\b/_
\bd_
\be_
\bv_
\b/_
\bf_
\bd_
\b/_
\b# refer to file descriptors which can
be accessed through the file system. If the file descriptor is open and
the mode the file is being opened with is a subset of the mode of the ex-
isting descriptor, the call:
fd = open("/dev/fd/0", mode);
fd = fcntl(0, F_DUPFD, 0);
Opening the files _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\bi_
\bn, _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\bo_
\bu_
\bt and _
\b/_
\bd_
\be_
\bv_
\b/_
\bs_
\bt_
\bd_
\be_
\br_
\br is equivalent
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are
S
\bSE
\bEE
\bE A
\bAL
\bLS
\bSO
\bO