Go to the source code of this file.
|
int | pcmk__add_mainloop_ipc (crm_ipc_t *ipc, int priority, void *userdata, const struct ipc_client_callbacks *callbacks, mainloop_io_t **source) |
| Connect to IPC and add it as a main loop source. More...
|
|
guint | pcmk__mainloop_timer_get_period (const mainloop_timer_t *timer) |
| Get period for mainloop timer. More...
|
|
void | pcmk__xe_add_node (xmlNode *xml, const char *node, int nodeid) |
|
int | pcmk__scan_nvpair (const char *input, char **name, char **value) |
|
char * | pcmk__format_nvpair (const char *name, const char *value, const char *units) |
|
pid_t | pcmk__procfs_pid_of (const char *name) |
|
unsigned int | pcmk__procfs_num_cores (void) |
|
int | pcmk__procfs_pid2path (pid_t pid, char path[], size_t path_size) |
|
bool | pcmk__procfs_has_pids (void) |
|
int | pcmk__pid_active (pid_t pid, const char *daemon) |
|
int | pcmk__read_pidfile (const char *filename, pid_t *pid) |
|
int | pcmk__pidfile_matches (const char *filename, pid_t expected_pid, const char *expected_name, pid_t *pid) |
|
int | pcmk__lock_pidfile (const char *filename, const char *name) |
|
void | pcmk__daemonize (const char *name, const char *pidfile) |
|
void | pcmk__panic (const char *reason) |
|
pid_t | pcmk__locate_sbd (void) |
|
void | pcmk__sleep_ms (unsigned int ms) |
|
guint | pcmk__create_timer (guint interval_ms, GSourceFunc fn, gpointer data) |
|
guint | pcmk__timeout_ms2s (guint timeout_ms) |
|
int | pcmk__effective_rc (int rc) |
|
◆ pcmk__assert_alloc
#define pcmk__assert_alloc |
( |
|
nmemb, |
|
|
|
size |
|
) |
| pcmk__assert_alloc_as(__FILE__, __func__, __LINE__, nmemb, size) |
◆ PCMK__FAIL_COUNT_PREFIX
#define PCMK__FAIL_COUNT_PREFIX "fail-count" |
◆ PCMK__LAST_FAILURE_PREFIX
#define PCMK__LAST_FAILURE_PREFIX "last-failure" |
◆ PCMK__NELEM
#define PCMK__NELEM |
( |
|
a | ) |
((int) (sizeof(a)/sizeof(a[0])) ) |
◆ pcmk__add_mainloop_ipc()
Connect to IPC and add it as a main loop source.
- Parameters
-
[in,out] | ipc | IPC connection to add |
[in] | priority | Event source priority to use for connection |
[in] | userdata | Data to register with callbacks |
[in] | callbacks | Dispatch and destroy callbacks for connection |
[out] | source | Newly allocated event source |
- Returns
- Standard Pacemaker return code
- Note
- On failure, the caller is still responsible for ipc. On success, the caller should call mainloop_del_ipc_client() when source is no longer needed, which will lead to the disconnection of the IPC later in the main loop if it is connected. However the IPC disconnects, mainloop_gio_destroy() will free ipc and source after calling the destroy callback.
Definition at line 861 of file mainloop.c.
◆ pcmk__create_timer()
guint pcmk__create_timer |
( |
guint |
interval_ms, |
|
|
GSourceFunc |
fn, |
|
|
gpointer |
data |
|
) |
| |
◆ pcmk__daemonize()
void pcmk__daemonize |
( |
const char * |
name, |
|
|
const char * |
pidfile |
|
) |
| |
◆ pcmk__effective_rc()
int pcmk__effective_rc |
( |
int |
rc | ) |
|
◆ pcmk__format_nvpair()
char* pcmk__format_nvpair |
( |
const char * |
name, |
|
|
const char * |
value, |
|
|
const char * |
units |
|
) |
| |
◆ pcmk__locate_sbd()
pid_t pcmk__locate_sbd |
( |
void |
| ) |
|
◆ pcmk__lock_pidfile()
int pcmk__lock_pidfile |
( |
const char * |
filename, |
|
|
const char * |
name |
|
) |
| |
◆ pcmk__mainloop_timer_get_period()
Get period for mainloop timer.
- Parameters
-
- Returns
- Period in ms
Definition at line 907 of file mainloop.c.
◆ pcmk__panic()
void pcmk__panic |
( |
const char * |
reason | ) |
|
◆ pcmk__pid_active()
int pcmk__pid_active |
( |
pid_t |
pid, |
|
|
const char * |
daemon |
|
) |
| |
Definition at line 19 of file pid.c.
◆ pcmk__pidfile_matches()
int pcmk__pidfile_matches |
( |
const char * |
filename, |
|
|
pid_t |
expected_pid, |
|
|
const char * |
expected_name, |
|
|
pid_t * |
pid |
|
) |
| |
◆ pcmk__procfs_has_pids()
bool pcmk__procfs_has_pids |
( |
void |
| ) |
|
◆ pcmk__procfs_num_cores()
unsigned int pcmk__procfs_num_cores |
( |
void |
| ) |
|
◆ pcmk__procfs_pid2path()
int pcmk__procfs_pid2path |
( |
pid_t |
pid, |
|
|
char |
path[], |
|
|
size_t |
path_size |
|
) |
| |
◆ pcmk__procfs_pid_of()
pid_t pcmk__procfs_pid_of |
( |
const char * |
name | ) |
|
◆ pcmk__read_pidfile()
int pcmk__read_pidfile |
( |
const char * |
filename, |
|
|
pid_t * |
pid |
|
) |
| |
◆ pcmk__scan_nvpair()
int pcmk__scan_nvpair |
( |
const char * |
input, |
|
|
char ** |
name, |
|
|
char ** |
value |
|
) |
| |
◆ pcmk__sleep_ms()
void pcmk__sleep_ms |
( |
unsigned int |
ms | ) |
|
◆ pcmk__timeout_ms2s()
guint pcmk__timeout_ms2s |
( |
guint |
timeout_ms | ) |
|
◆ pcmk__xe_add_node()
void pcmk__xe_add_node |
( |
xmlNode * |
xml, |
|
|
const char * |
node, |
|
|
int |
nodeid |
|
) |
| |
◆ pcmk__is_daemon
◆ pcmk__score_green
◆ pcmk__score_red
◆ pcmk__score_yellow