fd(4) fd(4)
/dev/fd - file descriptor files
These files, conventionally called /dev/fd/0, /dev/fd/1, /dev/fd/2, and
so on, refer to files accessible through file descriptors. If file
descriptor n is open, these two system calls have the same effect:
fd = open("/dev/fd/n<b>",mode);
fd = dup(n<b>);
On these files creat(2) is equivalent to open, and mode is ignored. As
with dup, subsequent reads or writes on fd fail unless the original file
descriptor allows the operations.
open(2), dup(2)
open(2) returns -1 and EBADF if the associated file descriptor is not
open.
PPPPaaaaggggeeee 1111 [ Back ]
|