ham_heartbeat_control()
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:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |