man(1) Manual page archive


     FD(4)                                                       FD(4)

     NAME
          fd, stdin, stdout, stderr, tty - file descriptor files

     DESCRIPTION
          These files, conventionally called /dev/fd/0, /dev/fd/1, ...
          /dev/fd/127, refer to files accessible through file descrip-
          tors.  If file descriptor n is open, these two system calls
          have the same effect:

               fd = open("/dev/fd/n", mode);
               fd = dup(n);

          On these devices creat (see open(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.

     FILES
          not open and in the appropriate mode (reading or writing).