ha_ConnectAttach(), ha_ConnectAttach_r()

Create a connection and attach it to the HA lib

Synopsis:

#include <ha/neutrino.h>
    
int ha_ConnectAttach(_Uint32t *nd, 
                     pid_t pid,        
                     int chid,         
                     unsigned index,   
                     unsigned flags,   
                     RFp rfn,          
                     void *rhdl,       
                     unsigned haflags);

int ha_ConnectAttach_r(_Uint32t *nd,     
                       pid_t pid,        
                       int chid,         
                       unsigned index,   
                       unsigned flags,   
                       RFp rfn,          
                       void *rhdl,
                       unsigned haflags);

Library:

libha

Description:

The ha_ConnectAttach() and ha_ConnectDetach_r() functions are identical except in the way they return errors. (For details, see the "Returns" section.)

In addition to creating the connection using the standard ConnectAttach|_r() call, these convenience functions also call ha_attach() with the connection returned by the ConnectAttach() call.

The parameters rfn(), and rhdl(), and haflags() are passed to the ha_attach() call along with the connection ID returned by the ConnectAttach() call.

The remaining parameters are passed to the corresponding parameters in the ConnectAttach() call in their appropriate positions.

Returns:

The only difference between these functions is the way they indicate errors:

ha_ConnectAttach()
A connection ID that's used by the message primitives. If an error occurs, -1 is returned and errno is set.
ha_ConnectAttach_r()
A connection ID that's used by the message primitives. This function does NOT set errno. If an error occurs, the negative of a value from the errors returned by either the underlying ConnectAttach() call or the ha_attach() call.

Errors:

The ha_ConnectAttach|_r() call returns errors as returned by either the underlying ConnectAttach() call or the ha_attach() call.

Classification:

QNX Neutrino

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