dup, dup2 \- duplicate an open file descriptor
a file descriptor returned from
allocates another file descriptor
The new file descriptor is returned.
In the second form of the call,
is a file descriptor referring to an open file, and
is a non-negative integer less than the maximum value
allowed for file descriptors (approximately 19).
to refer to the same file as
already referred to an open file, it is closed first.
creat(2), open(2), close(2), pipe(2)
The value \-1 is returned if:
the given file descriptor is invalid;
there are already too many open files.
(new file descriptor in r1)
entry is implemented by adding 0100 to
from and some of the pages have not been referenced.