Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ fd(4) — Reliant UNIX 5.44c4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

open(2)

dup(2)

fd(4)                                                                 fd(4)

NAME
     fd - /dev/fd file descriptor files

DESCRIPTION
     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",mode);
          fd = dup(n);

     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.

     For convenience in referring to standard input, standard output, and
     standard error, an additional set of names is provided: /dev/fd/0 is a
     synonym for stdin, /dev/fd/1 for stdout, and /dev/fd/2 for stderr. In
     fact, /dev/fd/n is a synonym for any valid file descriptor n for that
     process.

NOTE
     This is true only if /dev/fd is the mount point of the fdfs file sys-
     tem type. Normally, this mount is done automatically.

DIAGNOSTICS
     open(2) returns -1 and EBADF if the associated file descriptor is not
     open.

SEE ALSO
     open(2), dup(2).
























Page 1                       Reliant UNIX 5.44                Printed 11/98

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026