dup(2) DG/UX 4.30 dup(2)
NAME
dup - Duplicate an open file descriptor.
SYNOPSIS
int dup (fildes)
int fildes;
PARAMETERS
fildes A valid, active file descriptor.
DESCRIPTION
If <fildes> is a valid, active descriptor, then this call
returns a new file descriptor with both descriptors sharing
the same object pointer. The new descriptor is set to
remain open across exec system calls. This call is
identical to new_filedes = fcntl (filedes, F_DUPFD, 0).
ACCESS CONTROL
None.
RETURN VALUE
0..<NOFILE-1> The value of the new file descriptor.
-1 An error occurred. Errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EBADF <Fildes> is not a valid, active descriptor.
EMFILE All descriptors are open.
SEE ALSO
The related manual sections: accept(2), close(2), creat(2),
dup2(2), exec(2), fcntl(2), getdtablesize(2), open(2),
pipe(2), socket(2), socketpair(2).
STANDARDS
When using m88kbcs as the Software Development Environment
target, the dup function will be emulated using the fcntl(2)
system call. Since this is an emulation, a slight
performance degradation may be noticed in comparison to
using dup in /lib/libc.a.
Licensed material--property of copyright holder(s) Page 1