dup man page on UNIXv7

Man page or keyword search:  
man Server   300 pages
apropos Keyword Search (all sections)
Output format
UNIXv7 logo
[printable version]

DUP(2)									DUP(2)

NAME
       dup, dup2 - duplicate an open file descriptor

SYNOPSIS
       dup(fildes)
       int fildes;

       dup2(fildes, fildes2)
       int fildes, fildes2;

DESCRIPTION
       Given a file descriptor returned from an open, pipe, or creat call, dup
       allocates another file descriptor synonymous with  the  original.   The
       new file descriptor is returned.

       In  the	second form of the call, fildes is a file descriptor referring
       to an open file, and fildes2 is a non-negative integer  less  than  the
       maximum	value  allowed	for file descriptors (approximately 19).  Dup2
       causes fildes2 to refer to the same file as fildes.  If fildes2 already
       referred to an open file, it is closed first.

SEE ALSO
       creat(2), open(2), close(2), pipe(2)

DIAGNOSTICS
       The  value  -1  is  returned  if: the given file descriptor is invalid;
       there are already too many open files.

ASSEMBLER
       (dup = 41.)
       (file descriptor in r0)
       (new file descriptor in r1)
       sys dup
       (file descriptor in r0)

       The dup2 entry is implemented by adding 0100 to fildes.

									DUP(2)
[top]

List of man pages available for UNIXv7

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net