ha_reopen()

Reopen a connection while performing recovery

Synopsis:

#include <ha/fcntl.h>
    
int ha_reopen(int oldfd, 
              const char *path, 
              int oflag, ...);

Library:

libha

Description:

You can use the ha_reopen() convenience function to reopen a connection while in the recovery phase. The oldfd argument refers to the connection that has failed. The ha_reopen() function closes the previous connection and opens a new connection using the parameters specified by calling open().

The ha_reopen() function also verifies that the new connection ID returned is the same as the oldfd (as required by the HA library mechanism). If the new connection ID obtained is not the same as oldfd, it will attempt to obtain the same fd, by calling the dup2() function.

Returns:

A new connection ID or -1 if an error occurred (errno is set).

Errors:

The ha_reopen() call returns errors as returned by the underlying open() call.

Classification:

QNX Neutrino

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