ham_connect()

QNX SDP8.0High Availability Framework Developer's GuideDeveloper

Connect to the HAM

Synopsis:

#include <ha/ham.h>

int ham_connect( unsigned flags);

Arguments:

flags
Currently not used.

Library:

libham

Description:

The ham_connect() function initializes a connection to a HAM.

Note:
A process may have only a single connection open to a HAM at any time.

You can call this function any number of times, but because the library maintains a reference count, you need to call ham_disconnect() the same number of times to release the connection.

Connections are associated with a specific process ID (pid). If a process performs ham_connect() and then calls fork(), the child process needs to reconnect to the HAM by calling ham_connect() again.

But if a process only calls any of the following:

it doesn't need to call ham_connect(), since those functions create their own temporary connection.

Note:
For all other ham*() functions, clients must call ham_connect() first. If the process is doing multiple operations, it is more efficient to explicitly call ham_connect() before the series of operations and ham_disconnect() afterwards to avoid multiple implicit connect/disconnect operations.

There are no flags defined at this time.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

Upon failure, the ham_connect() function returns the error as set by the underlying open() library call that failed.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerNo
ThreadYes
Page updated: