ham_heartbeat_control()

QNX SDP8.0High Availability Framework Developer's GuideDeveloper

Check the current state of, suspend, or resume heartbeat handling in a HAM

Synopsis:

#include <ha/ham.h>

int ham_heartbeat_control(const char *reserved, int command);

Arguments:

reserved
Set this argument to NULL.
command
The operation to perform; one of the following:
  • HAM_HEARTBEAT_SUSPEND — Suspend checking for expired heartbeats.
  • HAM_HEARTBEAT_ACTIVE — Resume checking for expired heartbeats.
  • HAM_HEARTBEAT_QUERY — Return the current state of heartbeats, that is, suspended or resumed.

Library:

libham

Description:

The ham_heartbeat_control() function can be used to suspend or resume checking for expired heartbeats, or to check on the current state of heartbeat checking of a HAM. You can also use the hamctrl utility to do this.

If heartbeating is suspended, the HAM will stop checking for missed heartbeats. In other words, if any application misses heartbeats while checking is suspended, those will not count as missed heartbeats. Thus, neither CONDHBEATMISSEDLOW nor CONDHBEATMISSEDHIGH conditions will become active.

When hearbeats are resumed and become active, the HAM will treat this as if every heartbeat client has issued a heartbeat at the point in time that heartbeat handling is resumed. That is, their heartbeat interval will start counting from the resume time.

Returns:

If successful, this function returns the previous state of heartbeating in the HAM, which is also the current state for the query operation. If an error occurs, this function returns -1 (errno is set).

Errors:

EBADF
Couldn't connect to the HAM.
EINVAL
The command variable is invalid.

In addition to the above errors, the HAM returns any error it encounters while servicing this request.

Classification:

QNX OS

Safety:
Cancellation pointNo
Signal handlerNo
ThreadYes
Page updated: