SYNOPSIS
#include <unistd.h>
int dup(int fildes);
DESCRIPTION
The
On success,
- Same open file (or pipe)
- Same file pointer (both file descriptors share one file pointer)
- Same access mode (read, write, or read/write)
The new file descriptor is set
to remain open across
PARAMETERS
RETURN VALUES
If successful,
- EBADF
-
fildes is not a valid open file descriptor.
- EINTR
-
A signal was caught during the
dup() system call. - EMFILE
-
The number of file descriptors exceeds OPEN_MAX.
CONFORMANCE
POSIX.1 (1996)
MULTITHREAD SAFETY LEVEL
Async-signal-safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
close() ,creat() ,dup2() ,execl() ,execle() ,execlp() ,execlpe() ,execv() ,execve() ,execvp() ,execvpe() ,fcntl() ,lockf() ,open() ,pipe() ,socket()
PTC MKS Toolkit 10.4 Documentation Build 39.