Query: dup
OS: sunos
Section: 2
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
dup(2) System Calls dup(2)NAMEdup - duplicate an open file descriptorSYNOPSIS#include <unistd.h> int dup(int fildes);DESCRIPTIONThe dup() function returns a new file descriptor having the following in common with the original open file descriptor fildes: o same open file (or pipe) o same file pointer (that is, both file descriptors share one file pointer) o same access mode (read, write or read/write). The new file descriptor is set to remain open across exec functions (see fcntl(2)). The file descriptor returned is the lowest one available. The dup(fildes) function call is equivalent to: fcntl(fildes, F_DUPFD, 0)RETURN VALUESUpon successful completion, a non-negative integer representing the file descriptor is returned. Otherwise, -1 is returned and errno is set to indicate the error.ERRORSThe dup() function will fail if: EBADF The fildes argument is not a valid open file descriptor. EINTR A signal was caught during the execution of the dup() function. EMFILE The process has too many open files (see getrlimit(2)). ENOLINK The fildes argument is on a remote machine and the link to that machine is no longer active.ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Async-Signal-Safe | +-----------------------------+-----------------------------+SEE ALSOclose(2), creat(2), exec(2), fcntl(2), getrlimit(2), open(2), pipe(2), dup2(3C), lockf(3C), attributes(5), standards(5) SunOS 5.10 28 Dec 1996 dup(2)
Related Man Pages |
---|
dup(2) - mojave |
dup2(3c) - opensolaris |
dup2(3c) - php |
dup2(3c) - xfree86 |
dup2(3c) - v7 |
Similar Topics in the Unix Linux Community |
---|
File status - open/close ?? |
dup() |
Shell Implementation not working correctly |
Difference between file descriptor and file pointer |
Deja-dup make my / full. So I cannot restore my back up |