Unix and Linux Discussions Tagged with file descriptor |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
3,887 |
Shell Programming and Scripting |
|
|
|
19 |
14,058 |
Solaris |
|
|
|
9 |
10,109 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,078 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
5,085 |
Shell Programming and Scripting |
|
|
|
3 |
4,387 |
Programming |
|
|
|
0 |
1,538 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
5,111 |
Shell Programming and Scripting |
|
|
|
5 |
3,522 |
Programming |
|
|
|
2 |
16,103 |
Programming |
|
|
|
6 |
10,635 |
Shell Programming and Scripting |
|
|
|
2 |
3,596 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
22,014 |
IP Networking |
|
|
|
6 |
12,441 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
18,561 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
11,993 |
Programming |
|
|
|
3 |
18,433 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
15,818 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,543 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
4,340 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,600 |
UNIX for Dummies Questions & Answers |
dup(2) System Calls Manual dup(2)
NAME
dup - duplicate an open file descriptor
SYNOPSIS
DESCRIPTION
fildes is a file descriptor obtained from a or system call. returns a new file descriptor having the following in common with the origi-
nal:
o Same open file (or pipe).
o Same file pointer (i.e., both file descriptors share one file pointer).
o Same access mode (read, write or read/write).
o Same file status flags (see fcntl(2),
The new file descriptor is set to remain open across system calls. See fcntl(2).
The file descriptor returned is the lowest one available.
RETURN VALUE
Upon successful completion, the file descriptor is returned as a non-negative integer. Otherwise, a value of -1 is returned and is set to
indicate the error.
ERRORS
fails if one or more of the following is true:
fildes is not a valid open file descriptor.
Request violates the maximum number of open file descriptors.
AUTHOR
was developed by AT&T and HP.
SEE ALSO
close(2), creat(2), dup2(2), exec(2), fcntl(2), open(2), pipe(2), privileges(5).
STANDARDS CONFORMANCE
dup(2)