dupfd()
QNX SDP8.0C Library ReferenceAPIDeveloper
Duplicate a file descriptor from another process
Synopsis:
#include <sys/dupfd.h>
           
int dupfd( const dupfd_handle_t handle,
           const int flags );
           
Arguments:
- handle
 - The handle that represents the file descriptor to duplicate.
 - flags
 - Connection flags as defined for ConnectAttach().
 
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The dupfd() function duplicates a file descriptor from another process referenced by handle. The other process must have called dupfd_register() to create the handle.
Returns:
A new file descriptor if successful, or -1 if an error occured (errno is set).
Errors:
- ENOENT
 - The handle is invalid. The most likely cause is that the file descriptor has previously been closed.
 - EBADF
 - The file descriptor being duplicated was closed. (Equivalent to ENOENT.)
 - EMFILE
 - All file descriptors available to the process are currently open.
 - ENOSYS
 - The resource manager that the file descriptor is associated with doesn't support duplication operations.
 
Classification:
| Safety: | |
|---|---|
| Cancellation point | No | 
| Signal handler | Yes | 
| Thread | Yes | 
Page updated: 
