ham_stop(), ham_stop_nd(), ham_stop_node()

Stop the HAM

Synopsis:

#include <ha/ham.h>

int ham_stop( void );
int ham_stop_nd( int nd);
int ham_stop_node( const char *nodename);


Arguments:

nd
(ham_stop_nd() only) The node identifier to the targeted remote node. 0/ND_LOCAL_NODE is the default case.
nodename
(ham_stop_node() only) The targeted remote HAM. If NULL is specified for nodename, then it will be ignored.

Library:

libham

Description:

The ham_stop() function instructs the HAM to terminate. The ham_stop_nd(), and ham_stop_node() functions are used to terminate remote HAMs. These are the only proper ways to stop the HAM.

The nd specified to ham_stop_nd() is the node identifier of the remote node at the time the ham_stop_nd() call is made.

Note: Since node identifiers are transient objects, you should obtain the value for nd immediately before the call, using netmgr_strtond() or another function that converts nodenames into node identifiers.

The ham_stop_node() function takes as a parameter a fully qualified node name (FQNN). The ham_stop_node() function is used when a nodename is used to specify a remote HAM instead of a node identifier (nd).

Since the HAM and its “clone” the Guardian monitor each other, and re-spawn should the other fail, the HAM must first terminate the Guardian before it terminates itself.

Returns:

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

Errors:

EBADF
Couldn't connect to the HAM.

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

Classification:

QNX Neutrino

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