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.
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.