Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 8

ha_dup()

Duplicate an HA connection

Synopsis:

#include <ha/unistd.h>
    
int ha_dup(int oldfd);

Library:

libha

Description:

The ha_dup() function duplicates the HA-aware file descriptor specified by oldfd. The functionality of ha_dup() is similar to that of the standard dup() call, with the addition that the new file descriptor also shares the recovery mechanisms associated with oldfd.

Changing the recovery function for one file descriptor will automatically change the recovery function for the other as well.

Note that HA connections are also reference-counted across ha_dup() calls. This implies that when HA connections that have been dup()'d are closed, the recovery functions will continue to exist until the last reference to them has been closed.

Returns:

The new file descriptor or -1 if an error occurred (errno is set).

Errors:

EBADF
The connection identified by oldfd isn't an HA-aware connection.
ENOMEM
Couldn't allocate memory for structures in the library to successfully duplicate the connection.

In addition, the ha_dup() call returns any errors returned by the underlying dup() call.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

ha_attach(), ha_close(), ha_detach(), ha_open()

In the Library Reference: dup()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 130

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/ham_en/ham/clientlib/ha_dup.html on line 130