BSD 4_4 development
[unix-history] / usr / share / man / cat4 / stdout.0
FD(4) BSD Programmer's Manual FD(4)
N\bNA\bAM\bME\bE
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);
and the call:
fd = fcntl(0, F_DUPFD, 0);
are equivalent.
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
to the following calls:
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
ignored.
F\bFI\bIL\bLE\bES\bS
/dev/fd/#
/dev/stdin
/dev/stdout
/dev/stderr
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
tty(4)
4.4BSD June 9, 1993 1