Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

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  
 
Program Interfacecmm_notify_getfd(3CMM)


NAME

 cmm_notify_getfd - receive cluster membership change messages

SYNOPSIS

 
cc [ flag... ] file...  -lcgha_cmm  -lrt
 
#include <cmm.h>
cmm_error_t cmm_notify_getfd(int * const fd);

DESCRIPTION

The cmm_notify_getfd() function stores a file descriptor, in fd. This descriptor detects the cluster membership change control messages sent by the nhcmmd daemon. System services or applications that require cluster membership change notification delivery must use the cmm_notify_getfd() and the cmm_notify__dispatch() functions to receive and process messages from the nhcmmd daemon.

The fd parameter points to the location where the function stores the file descriptor used to receive messages from nhcmmd.

EXTENDED DESCRIPTION

Use the select() or poll() functions and the file descriptor returned from cmm_notify_getfd() to detect messages arriving from nhcmmd. When the file descriptor indicates that data must be read, cmm_notify_dispatch() must be called. This triggers the associated callback registered through cmm_cmc_register().

If an error occurs on this file descriptor within poll() or if the file descriptor is no longer valid, cmm_notify_dispatch() returns a CMM_EBADF error. The thread that received this error must call the cmm_cmc_unregister() and the whole registration process must be performed, that is calling the cmm_cmc_register(), cmm_cmc_filter(), and cmm_notify_getfd() functions.

If the fork command is called, the returned file descriptor is automatically closed in the created child process. The file descriptor is only valid within the parent.

If an application calls the cmm_notify_getfd() function, it must use the returned file descriptor. The Cluster Membership Manager (CMM) library itself does not monitor events, so if the calling process does not call the cmm_notify_dispatch() function when an event occurs, the events accumulate without being handled.

RETURN VALUES

The cmm_notify_getfd() function returns one of the following values:

CMM_EINVAL

Invalid argument.

CMM_ENOENT

No callback is currently registered.

CMM_OK

Operation succeeds

ATTRIBUTES

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

ATTRIBUTE TYPEATTRIBUTE VALUE
ArchitectureSPARC
AvailabilitySUNWnhcmd
Interface StabilityEvolving
MT-LevelMT-Safe
Cancel-SafetyDeferred-Cancel-Safe Asynchronous-Cancel-Unsafe

SEE ALSO

Intro(3CMM), select(3c), nhcmmd(1M), fork(2), poll(2), cmm_cmc_filter(3CMM), cmm_cmc_register(3CMM), cmm_cmc_unregister(3CMM), cmm_notify_dispatch(3CMM), select(3c), poll(2)


Netra HAS FS 2.1Go To TopLast Changed September 2004