Sun Microsystems, Inc.
   www.sun.com docs.sun.com | | |  
   
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
    
 
Sun Cluster HA and Data Servicesscha_cluster_getnodename(3HA)


NAME

 scha_cluster_getnodename - local cluster node name access function

SYNOPSIS

 
cc [flags...]-I /usr/cluster/include file -L /usr/cluster/lib -l scha
#include <scha.h>
scha_err_t scha_cluster_getnodename(char **nodename);

DESCRIPTION

 

The scha_cluster_getnodename() function returns the name of the cluster node on which the function is called. The cluster node name is not necessarily the same as the Solaris system name. The function returns an error status, and if successful, a string containing the node name in the location pointed to by the nodename argument. The nodename is set to NULL if the call fails. The caller of scha_cluster_getnodename() is responsible for freeing the memory allocated for the returned string value using the standard C library function free(3c). To avoid a core dump, only free the memory upon successful return of the function.


RETURN VALUES

 

The scha_cluster_getnodename() function returns the following:

0
The function succeeded.
non-zero
The function failed.

ERRORS

 
SCHA_ERR_NOERR
Function succeeded.

See scha_calls(3HA) for a description of other error codes.


EXAMPLES

 Example 1. Using the scha_cluster_getnodename() Function
 
 
      scha_err_t  err_code;
      char *nodename;
      err_code = scha_cluster_getnodename(&nodename);
      ...
      if( nodename != NULL ) free( nodename );

FILES

 
/usr/cluster/include/scha.h
include file
/usr/cluster/lib/libscha.so
library

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
AvailabilitySUNWscdev
Interface StabilityEvolving

SEE ALSO

 

free(3c), scha_calls(3HA), scha_cluster_get(3HA), scha_strerror(3HA), attributes(5)



Sun Cluster 3.1Go To TopLast Changed 17 Apr 2002

 
      
      
Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.