DataMuseum.dk

Presents historical artifacts from the history of:

ICL Comet 32

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about ICL Comet 32

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦a89a29023⟧ TextFile

    Length: 978 (0x3d2)
    Types: TextFile
    Notes: UNIX file
    Names: »dup.2«

Derivation

└─⟦26887b7e0⟧ Bits:30009717 Comet 32 harddisk image
    └─⟦28c352965⟧ »/a« UNIX Filesystem
        └─⟦this⟧ »usr/man/man2/dup.2« 

TextFile

.ig
	@(#)dup.2	2.1	7/1/84
	@(#)Copyright (C) 1983 by National Semiconductor Corp.
..
.TH DUP 2 
.SH NAME
dup, dup2 \- duplicate an open file descriptor
.SH SYNOPSIS
.nf
.B dup(fildes)
.B int fildes;
.PP
.B dup2(fildes, fildes2)
.B int fildes, fildes2;
.fi
.SH DESCRIPTION
Given
a file descriptor returned from
an
.I open,
.I pipe,
or
.I creat
call,
.I dup
allocates another file descriptor
synonymous
with
the original.
The new file descriptor is returned.
.PP
In the second form of the call,
.I fildes
is a file descriptor referring to an open file, and
.I fildes2
is a non-negative integer less than the maximum value
allowed for file descriptors (approximately 19).
.I Dup2
causes
.I fildes2
to refer to the same file as
.I fildes.
If
.I fildes2
already referred to an open file, it is closed first.
.SH "SEE ALSO"
creat(2), open(2), close(2), pipe(2)
.SH DIAGNOSTICS
The value \-1 is returned if:
the given file descriptor is invalid;
there are already too many open files.