FD(7FS) | File Systems | FD(7FS) |
fd
, stdin
,
stdout
, stderr
—
fd = open("/dev/fd/<n>", mode); fd = dup(n);
On these files creat(2) is equivalent to open(2), and mode is ignored. As with dup(2), subsequent reads or writes on fd fail unless the original file descriptor allows the operations.
For convenience in referring to standard input, standard output, and standard error, an additional set of names is provided: /dev/stdin is a synonym for /dev/fd/0, /dev/stdout for /dev/fd/1, and /dev/stderr for /dev/fd/2.
EBADF
if the
associated file descriptor is not open.
July 3, 1990 | OmniOS |