Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

scds_initialize(3ha) [opensolaris man page]

scds_initialize(3HA)					 Sun Cluster HA and Data Services				      scds_initialize(3HA)

NAME
scds_initialize - allocate and initialize DSDL environment SYNOPSIS
cc [flags...] -I /usr/cluster/include file -L /usr/cluster/lib -l dsdev #include <rgm/libdsdev.h> scha_err_t scds_initialize(scds_handle_t *handleint argc, char *argv[] DESCRIPTION
The scds_initialize() function initializes the DSDL environment. You must call this function once at the beginning of each program or fault monitor that uses any other DSDL functions. The scds_initialize() function does the following: o Checks and processes the command line arguments (argc and argv[]) that the framework passes to the calling program and that must be passed along to scds_initialize(). No further processing of the command line arguments is required of the calling program. See EXAMPLES. o Sets up internal data structures with information needed by the other functions in the DSDL. It retrieves resource, resource type, and resource group property values and stores them in these data structures. Values for any properties supplied on the command line by means of the argv[] argument take precedence over those retrieved from the RGM. That is, if a new value for a property has been specified in the command line arguments (argv[]) passed to the data service method, then this new value is returned by the function that retrieves that property's value. Otherwise, the existing value retrieved from the RGM is returned. o Initializes the data service fault monitoring information o Initializes the logging environment. All syslog messages are prefixed with: SC[<resourceTypeName>,<resourceGroupName>,<resource- Name>,<methodName> Functions that send messages to syslog use the facility returned by scha_cluster_getlogfacility(). These messages can be for- warded to appropriate log files and users. See syslog.conf(4) for more information. o Validates fault monitor probe settings. It verifies that the Retry_interval is greater than or equal to (Thorough_probe_interval * Retry_count). If this is not true, it sends an appropriate message to the syslog facility. You could call scds_initialize() and scds_close() in a VALIDATE method for this validation of the fault monitor probe settings even if you call no other DSDL functions in the VALIDATE method. If scds_initialize() succeeds, you must call scds_close() before exiting the calling program. If scds_initialize() fails, you must not call scds_close() to clean up. When scds_initialize() fails, do not call any other DSDL functions. Otherwise, they return SCHA_ERR_INVAL or a NULL value. Instead, call exit() with a non-zero argument. PARAMETERS
The following parameters are supported: handle A handle initialized by scds_initialize() and used by other DSDL functions. argc Number of arguments that is passed to the calling program. argv Pointer to an argument array passed to the calling program. ERRORS
SCHA_ERR_NOERR The function succeeded. See scha_calls(3HA) for a description of other error codes. EXAMPLES
Example 1 Using scds_initialize() int main(int argc, char *argv[]){ scds_handle_t handle; if (scds_initialize(&handle, argc, argv) != SCHA_ERR_NOERR) exit(1); /* data service code */ ... scds_close(&handle); } FILES
/usr/cluster/include/rgm/libdsdev.h Include file /usr/cluster/lib/libdsdev.so Library ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscdev | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
scds_close(3HA), scds_property_functions(3HA), scha_calls(3HA), scha_cluster_getlogfacility(3HA), syslog.conf(4), r_properties(5) Sun Cluster 3.2 7 Sep 2007 scds_initialize(3HA)
Man Page