Index Index for
Section 3
Index Alphabetical
listing for I
Bottom of page Bottom of
page

imc_wait_cluster_event(3)

NAME

imc_wait_cluster_event - Blocks the caller until a Memory Channel Application Programming Interface (API) cluster event occurs.

LIBRARY

Memory Channel API library (libimc.a)

SYNOPSIS

#include <sys/imc.h> int imc_wait_cluster_event ( imc_eventType *i_eventType, unsigned long i_numEvents, unsigned long i_unused, [void *io_current_config, unsigned long i_current_config_length]... );

PARAMETERS

i_eventType Points to a data structure that contains information about valid Memory Channel API cluster events for which to wait. The i_eventType parameter has the following values: IMC_CC_EVENT_HOST A host has joined the Memory Channel API cluster, or a host has been removed from the Memory Channel API cluster. IMC_CC_EVENT_RAIL The logical rail configuration of the Memory Channel API cluster has changed; a logical rail has come on line, or a logical rail has gone off line. Note A Memory Channel API cluster is formed when a number of hosts are physically connected by a Memory Channel interconnect, and when each host has invoked the imc_init(1) command. i_numEvents Specifies the number of events in the data structure identified by the i_eventType parameter. This parameter must have a value of one or greater. i_unused This parameter is currently unused. You must set the value of this parameter to zero (0). io_current_config Points to a data structure that contains information about the Memory Channel API cluster configuration item being monitored. There are two valid data structure types, as follows: imc_hostinfo If the i_eventType parameter has the value IMC_CC_EVENT_HOST, the io_current_config parameter points to a structure of type imc_hostinfo, returned by the imc_getclusterinfo() function. imc_railinfo If the i_eventType parameter has the value IMC_CC_EVENT_RAIL, the io_current_config parameter points to a object of type imc_railinfo, returned by the imc_getclusterinfo() function. If a value of NULL is specified for the io_current_config parameter, the imc_wait_cluster_event() function will use the current internal value of the Memory Channel API cluster configuration item being monitored. On return, the user must access this value using the imc_getclusterinfo() function. i_current_config_length Specifies the length of the io_current_config parameter. If the io_current_config parameter has a value of NULL, the i_current_config_length parameter is ignored.

DESCRIPTION

The imc_wait_cluster_event() function blocks the calling entity until a specified Memory Channel API cluster event occurs. Note The imc_wait_cluster_event() function waits for Memory Channel API cluster events, not Production Server cluster events. Two Memory Channel API cluster events are valid: · A host joins or leaves the Memory Channel API cluster. · The logical rail configuration of the Memory Channel API cluster changes. At least one Memory Channel API cluster event must be specified in the call to the imc_wait_cluster_event() function; more than one Memory Channel API cluster event may be specified. The imc_wait_cluster_event() function initially checks the current representation of the Memory Channel API cluster configuration item being monitored. On return, the io_current_config parameter points to the new Memory Channel API cluster configuration. If the io_current_config parameter has been set to a value of NULL, the imc_wait_cluster_event() function will use the current internal value of the Memory Channel API cluster configuration item being monitored; and the i_current_config_length parameter will be ignored. If this is the case, the user must access the value of the Memory Channel API cluster configuration item on return, using the imc_getclusterinfo() function.

EXAMPLES

1. The following program extract requests the names of the members of the Memory Channel API cluster using the imc_getclusterinfo() function, and then calls the imc_wait_cluster_event() function to wait for a configuration change to be notified: imc_hostinfo hostinfo; int status; imc_infotype items[2]; imc_eventType events[2]; items[0] = IMC_GET_HOSTS; items[1] = 0; events[0] = IMC_CC_EVENT_HOST; events[1] = 0; status = imc_getclusterinfo(items,1,&hostinfo,sizeof(imc_hostinfo)); if (status != IMC_SUCCESS) imc_perror("imc_getclusterinfo:",status); status = imc_wait_cluster_event(events,1,0,&hostinfo,sizeof(imc_hostinfo)); if (status != IMC_HOST_CHANGE) imc_perror("imc_wait_cluster_event didn't complete:",status); 2. The following program extract requests the names of the members of the Memory Channel API cluster and the active Memory Channel logical rails bitmask, and then waits for an event change on either: imc_railinfo mask; imc_hostinfo hostinfo; int status; imc_infoType items[3]; imc_eventType events[3]; items[0] = IMC_GET_ACTIVERAILS; items[1] = IMC_GET_HOSTS; items[2] = 0; events[0] = IMC_CC_EVENT_RAIL; events[1] = IMC_CC_EVENT_HOST; events[2] = 0; status = imc_getclusterinfo(items,2,mask,sizeof(imc_railinfo), &hostinfo,sizeof(imc_hostinfo)); if (status != IMC_SUCCESS) imc_perror("imc_getclusterinfo:",status); status = imc_wait_cluster_event(events, 2, 0, mask, sizeof(imc_railinfo), &hostinfo, sizeof(imc_hostinfo)); if ((status != IMC_HOST_CHANGE) && (status != IMC_RAIL_CHANGE)) imc_perror("imc_wait_cluster_event didn't complete:",status); 3. The following program extract waits for an event change on either the members of the Memory Channel API cluster or the active Memory Channel logical rails: int status; imc_eventType events[3]; events[0] = IMC_CC_EVENT_HOST; events[1] = IMC_CC_EVENT_RAIL; events[2] = 0; status = imc_wait_cluster_event(events, 2, 0, NULL, 0, NULL, 0); if ((status != IMC_HOST_CHANGE) && (status != IMC_RAIL_CHANGE)) imc_perror("imc_wait_cluster_event didn't complete:",status);

RETURN VALUES

The imc_wait_cluster_event() function returns one of the following values: IMC_NOTINIT This host has not been initialized to use the Memory Channel API library. IMC_BADPARM An invalid parameter was specified in the call to the imc_wait_cluster_event function. IMC_INTR The imc_wait_cluster_event function was interrupted by a signal. IMC_HOST_CHANGE The host configuration has changed. IMC_RAIL_CHANGE The logical rail configuration has changed. IMC_MULTIPLE_CHANGE More than one of the monitored configuration items has changed.

RELATED INFORMATION

Introduction: imc(3) Commands: imc_init(1), imcs(1) Functions: imc_api_init(3), imc_getclusterinfo(3) Cluster Highly Available Applications

Index Index for
Section 3
Index Alphabetical
listing for I
Top of page Top of
page