1SAM_REGISTER(3)   Corosync Cluster Engine Programmer's Manual  SAM_REGISTER(3)
2
3
4

NAME

6       sam_rehister - Register component for health checking
7
8

SYNOPSIS

10       #include <corosync/sam.h>
11
12
13       cs_error_t sam_register (unsigned int *instance_id);
14
15

DESCRIPTION

17       The   sam_register   function   is  used  to  register  a  process  for
18       healthchecking.   If  recovery  policy  is  set  to   SAM_RECOVERY_POL‐
19       ICY_RESTART and recovery action will be taken, the new process instance
20       will begin execution at the next  code  line  after  this  function  is
21       called.
22
23
24       This  function  can  be called only once and SAM must be initialized by
25       sam_initialize(3) function.
26
27
28       The instance_id argument is a pointer to a value  storing  the  current
29       iteration  instance.   If  this  parameter  is  NULL, no instance_id is
30       returned.  and then, no instance_id will be returned. This value starts
31       at  0  for the first iteration instance, and increases by 1 each time a
32       recovery restart is executed.  After reaching MAX_INT, the  instance_id
33       will reset to 0.
34
35
36       The placement of this function is important because after it is called,
37       the process id will change.
38
39
40       After registration, event driven health checking is not running.
41
42

RETURN VALUE

44       This call return CS_OK value if  successful,  otherwise  and  error  is
45       returned.
46
47

ERRORS

49       CS_ERR_BAD_HANDLE
50              health  checking  was  not started by calling sam_start(3) func‐
51              tion.
52
53       CS_ERR_LIBRARY
54              internal library call failed. This can be one of  pipe  creation
55              or fork.  It's possible to get more information from errno.
56
57

SEE ALSO

59       sam_start(3), sam_initialize(3), sam_hc_callback_register(3)
60
61
62
63corosync Man Page                 12/01/2009                   SAM_REGISTER(3)
Impressum