Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1785 KB)
dup(2)Name | Synopsis | Description | Return Values | Errors | Attributes | See Also Name
Synopsis#include <unistd.h> int dup(int fildes); Description
The dup() function returns a new file descriptor having the following in common with the original open file descriptor fildes: 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. Errors
The dup() function will fail if: AttributesSee attributes(5) for descriptions of the following attributes:
See Alsoclose(2), creat(2), exec(2), fcntl(2), getrlimit(2), open(2), pipe(2), dup2(3C), lockf(3C), attributes(5), standards(5) Name | Synopsis | Description | Return Values | Errors | Attributes | See Also |
||||||