Annotation of researchv10dc/man/adm/man2/dup.2, revision 1.1.1.1

1.1       root        1: .TH DUP 2
                      2: .CT 2 file_io
                      3: .SH NAME
                      4: dup, dup2 \(mi duplicate an open file descriptor
                      5: .SH SYNOPSIS
                      6: .nf
                      7: .B int dup(fildes)
                      8: .B int fildes;
                      9: .PP
                     10: .B int dup2(fildes, fildes2)
                     11: .B int fildes, fildes2;
                     12: .fi
                     13: .SH DESCRIPTION
                     14: Given
                     15: a file descriptor
                     16: .I dup
                     17: allocates another file descriptor
                     18: synonymous
                     19: with
                     20: the original.
                     21: The new file descriptor is returned.
                     22: .PP
                     23: In
                     24: .IR dup2 ,
                     25: .I fildes
                     26: is a file descriptor referring to an open file, and
                     27: .I fildes2
                     28: is an integer in the range of legal file descriptors.
                     29: .I Dup2
                     30: causes
                     31: .I fildes2
                     32: to refer to the same file
                     33: and returns 
                     34: .I fildes2.
                     35: If
                     36: .I fildes2
                     37: already referred to another open file, it is closed first.
                     38: .SH "SEE ALSO"
                     39: .IR open (2), 
                     40: .IR pipe (2), 
                     41: .IR fd (4)
                     42: .SH DIAGNOSTICS
                     43: .BR EBADF ,
                     44: .BR EMFILE
                     45: .SH BUGS
                     46: .I Dup
                     47: of a file descriptor greater than 63
                     48: turns into a
                     49: .I dup2
                     50: with a random second argument.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.