pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Enumerations | Functions
results.h File Reference

Function and executable result codes. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _Noreturn
 
#define CRM_ASSERT(expr)
 
#define pcmk_ok   0
 
#define PCMK_ERROR_OFFSET   190 /* Replacements on non-linux systems, see include/portability.h */
 
#define PCMK_CUSTOM_OFFSET   200 /* Purely custom codes */
 
#define pcmk_err_generic   201
 
#define pcmk_err_no_quorum   202
 
#define pcmk_err_schema_validation   203
 
#define pcmk_err_transform_failed   204
 
#define pcmk_err_old_data   205
 
#define pcmk_err_diff_failed   206
 
#define pcmk_err_diff_resync   207
 
#define pcmk_err_cib_modified   208
 
#define pcmk_err_cib_backup   209
 
#define pcmk_err_cib_save   210
 
#define pcmk_err_schema_unchanged   211
 
#define pcmk_err_cib_corrupt   212
 
#define pcmk_err_multiple   213
 
#define pcmk_err_node_unknown   214
 
#define pcmk_err_already   215
 
#define pcmk_err_bad_nvpair   216
 
#define pcmk_err_unknown_format   217
 

Typedefs

typedef enum crm_exit_e crm_exit_t
 

Enumerations

enum  pcmk_rc_e {
  pcmk_rc_no_input = -1027, pcmk_rc_no_output = -1026, pcmk_rc_after_range = -1025, pcmk_rc_within_range = -1024,
  pcmk_rc_before_range = -1023, pcmk_rc_undetermined = -1022, pcmk_rc_op_unsatisfied = -1021, pcmk_rc_ipc_pid_only = -1020,
  pcmk_rc_ipc_unresponsive = -1019, pcmk_rc_ipc_unauthorized = -1018, pcmk_rc_no_quorum = -1017, pcmk_rc_schema_validation = -1016,
  pcmk_rc_schema_unchanged = -1015, pcmk_rc_transform_failed = -1014, pcmk_rc_old_data = -1013, pcmk_rc_diff_failed = -1012,
  pcmk_rc_diff_resync = -1011, pcmk_rc_cib_modified = -1010, pcmk_rc_cib_backup = -1009, pcmk_rc_cib_save = -1008,
  pcmk_rc_cib_corrupt = -1007, pcmk_rc_multiple = -1006, pcmk_rc_node_unknown = -1005, pcmk_rc_already = -1004,
  pcmk_rc_bad_nvpair = -1003, pcmk_rc_unknown_format = -1002, pcmk_rc_error = -1001, pcmk_rc_ok = 0
}
 Return codes for Pacemaker API functions. More...
 
enum  crm_exit_e {
  CRM_EX_OK = 0, CRM_EX_ERROR = 1, CRM_EX_INVALID_PARAM = 2, CRM_EX_UNIMPLEMENT_FEATURE = 3,
  CRM_EX_INSUFFICIENT_PRIV = 4, CRM_EX_NOT_INSTALLED = 5, CRM_EX_NOT_CONFIGURED = 6, CRM_EX_NOT_RUNNING = 7,
  CRM_EX_USAGE = 64, CRM_EX_DATAERR = 65, CRM_EX_NOINPUT = 66, CRM_EX_NOUSER = 67,
  CRM_EX_NOHOST = 68, CRM_EX_UNAVAILABLE = 69, CRM_EX_SOFTWARE = 70, CRM_EX_OSERR = 71,
  CRM_EX_OSFILE = 72, CRM_EX_CANTCREAT = 73, CRM_EX_IOERR = 74, CRM_EX_TEMPFAIL = 75,
  CRM_EX_PROTOCOL = 76, CRM_EX_NOPERM = 77, CRM_EX_CONFIG = 78, CRM_EX_FATAL = 100,
  CRM_EX_PANIC = 101, CRM_EX_DISCONNECT = 102, CRM_EX_OLD = 103, CRM_EX_DIGEST = 104,
  CRM_EX_NOSUCH = 105, CRM_EX_QUORUM = 106, CRM_EX_UNSAFE = 107, CRM_EX_EXISTS = 108,
  CRM_EX_MULTIPLE = 109, CRM_EX_EXPIRED = 110, CRM_EX_NOT_YET_IN_EFFECT = 111, CRM_EX_INDETERMINATE = 112,
  CRM_EX_UNSATISFIED = 113, CRM_EX_TIMEOUT = 124, CRM_EX_MAX = 255
}
 

Functions

const char * pcmk_rc_name (int rc)
 Get a return code constant name as a string. More...
 
const char * pcmk_rc_str (int rc)
 Get a user-friendly description of a return code. More...
 
crm_exit_t pcmk_rc2exitc (int rc)
 Map a function return code to the most similar exit code. More...
 
int pcmk_rc2legacy (int rc)
 
int pcmk_legacy2rc (int legacy_rc)
 
const char * pcmk_strerror (int rc)
 
const char * pcmk_errorname (int rc)
 
const char * bz2_strerror (int rc)
 
crm_exit_t crm_errno2exit (int rc)
 
const char * crm_exit_name (crm_exit_t exit_code)
 
const char * crm_exit_str (crm_exit_t exit_code)
 
_Noreturn crm_exit_t crm_exit (crm_exit_t rc)
 

Detailed Description

Function and executable result codes.

Definition in file results.h.

Macro Definition Documentation

#define _Noreturn

Definition at line 38 of file results.h.

#define CRM_ASSERT (   expr)
Value:
do { \
if(__unlikely((expr) == FALSE)) { \
crm_abort(__FILE__, __FUNCTION__, __LINE__, #expr, TRUE, FALSE); \
abort(); /* Redundant but it makes static analyzers happy */ \
} \
} while(0)
void crm_abort(const char *file, const char *function, int line, const char *condition, gboolean do_core, gboolean do_fork)
Definition: utils.c:341
#define __unlikely(expr)
Definition: crm.h:69

Definition at line 42 of file results.h.

#define PCMK_CUSTOM_OFFSET   200 /* Purely custom codes */

Definition at line 69 of file results.h.

#define pcmk_err_already   215

Definition at line 84 of file results.h.

#define pcmk_err_bad_nvpair   216

Definition at line 90 of file results.h.

#define pcmk_err_cib_backup   209

Definition at line 78 of file results.h.

#define pcmk_err_cib_corrupt   212

Definition at line 81 of file results.h.

#define pcmk_err_cib_modified   208

Definition at line 77 of file results.h.

#define pcmk_err_cib_save   210

Definition at line 79 of file results.h.

#define pcmk_err_diff_failed   206

Definition at line 75 of file results.h.

#define pcmk_err_diff_resync   207

Definition at line 76 of file results.h.

#define pcmk_err_generic   201

Definition at line 70 of file results.h.

#define pcmk_err_multiple   213

Definition at line 82 of file results.h.

#define pcmk_err_no_quorum   202

Definition at line 71 of file results.h.

#define pcmk_err_node_unknown   214

Definition at line 83 of file results.h.

#define pcmk_err_old_data   205

Definition at line 74 of file results.h.

#define pcmk_err_schema_unchanged   211

Definition at line 80 of file results.h.

#define pcmk_err_schema_validation   203

Definition at line 72 of file results.h.

#define pcmk_err_transform_failed   204

Definition at line 73 of file results.h.

#define pcmk_err_unknown_format   217

Definition at line 91 of file results.h.

#define PCMK_ERROR_OFFSET   190 /* Replacements on non-linux systems, see include/portability.h */

Definition at line 68 of file results.h.

#define pcmk_ok   0

Definition at line 67 of file results.h.

Typedef Documentation

typedef enum crm_exit_e crm_exit_t

Enumeration Type Documentation

enum crm_exit_e
Enumerator
CRM_EX_OK 
CRM_EX_ERROR 
CRM_EX_INVALID_PARAM 
CRM_EX_UNIMPLEMENT_FEATURE 
CRM_EX_INSUFFICIENT_PRIV 
CRM_EX_NOT_INSTALLED 
CRM_EX_NOT_CONFIGURED 
CRM_EX_NOT_RUNNING 
CRM_EX_USAGE 
CRM_EX_DATAERR 
CRM_EX_NOINPUT 
CRM_EX_NOUSER 
CRM_EX_NOHOST 
CRM_EX_UNAVAILABLE 
CRM_EX_SOFTWARE 
CRM_EX_OSERR 
CRM_EX_OSFILE 
CRM_EX_CANTCREAT 
CRM_EX_IOERR 
CRM_EX_TEMPFAIL 
CRM_EX_PROTOCOL 
CRM_EX_NOPERM 
CRM_EX_CONFIG 
CRM_EX_FATAL 
CRM_EX_PANIC 
CRM_EX_DISCONNECT 
CRM_EX_OLD 
CRM_EX_DIGEST 
CRM_EX_NOSUCH 
CRM_EX_QUORUM 
CRM_EX_UNSAFE 
CRM_EX_EXISTS 
CRM_EX_MULTIPLE 
CRM_EX_EXPIRED 
CRM_EX_NOT_YET_IN_EFFECT 
CRM_EX_INDETERMINATE 
CRM_EX_UNSATISFIED 
CRM_EX_TIMEOUT 
CRM_EX_MAX 

Definition at line 171 of file results.h.

enum pcmk_rc_e

Return codes for Pacemaker API functions.

Any Pacemaker API function documented as returning a "standard Pacemaker return code" will return pcmk_rc_ok (0) on success, and one of this enumeration's other (negative) values or a (positive) system error number otherwise. The custom codes are at -1001 and lower, so that the caller may use -1 through -1000 for their own custom values if desired. While generally referred to as "errors", nonzero values simply indicate a result, which might or might not be an error depending on the calling context.

Enumerator
pcmk_rc_no_input 
pcmk_rc_no_output 
pcmk_rc_after_range 
pcmk_rc_within_range 
pcmk_rc_before_range 
pcmk_rc_undetermined 
pcmk_rc_op_unsatisfied 
pcmk_rc_ipc_pid_only 
pcmk_rc_ipc_unresponsive 
pcmk_rc_ipc_unauthorized 
pcmk_rc_no_quorum 
pcmk_rc_schema_validation 
pcmk_rc_schema_unchanged 
pcmk_rc_transform_failed 
pcmk_rc_old_data 
pcmk_rc_diff_failed 
pcmk_rc_diff_resync 
pcmk_rc_cib_modified 
pcmk_rc_cib_backup 
pcmk_rc_cib_save 
pcmk_rc_cib_corrupt 
pcmk_rc_multiple 
pcmk_rc_node_unknown 
pcmk_rc_already 
pcmk_rc_bad_nvpair 
pcmk_rc_unknown_format 
pcmk_rc_error 
pcmk_rc_ok 

Definition at line 106 of file results.h.

Function Documentation

const char* bz2_strerror ( int  rc)

Definition at line 718 of file results.c.

crm_exit_t crm_errno2exit ( int  rc)
Deprecated:
Use standard return codes and pcmk_rc2exitc() instead

Definition at line 570 of file results.c.

_Noreturn crm_exit_t crm_exit ( crm_exit_t  rc)

Definition at line 751 of file results.c.

const char* crm_exit_name ( crm_exit_t  exit_code)

Definition at line 472 of file results.c.

const char* crm_exit_str ( crm_exit_t  exit_code)

Definition at line 519 of file results.c.

const char* pcmk_errorname ( int  rc)
Deprecated:
Use standard return codes and pcmk_rc_name() instead

Definition at line 29 of file results.c.

int pcmk_legacy2rc ( int  legacy_rc)
Deprecated:
Use standard return codes instead

Definition at line 443 of file results.c.

crm_exit_t pcmk_rc2exitc ( int  rc)

Map a function return code to the most similar exit code.

Parameters
[in]rcFunction return code
Returns
Most similar exit code

Definition at line 613 of file results.c.

int pcmk_rc2legacy ( int  rc)
Deprecated:
Use standard return codes instead

Definition at line 430 of file results.c.

const char* pcmk_rc_name ( int  rc)

Get a return code constant name as a string.

Parameters
[in]rcInteger return code to convert
Returns
String of constant name corresponding to rc

Definition at line 259 of file results.c.

const char* pcmk_rc_str ( int  rc)

Get a user-friendly description of a return code.

Parameters
[in]rcInteger return code to convert
Returns
String description of rc

Definition at line 413 of file results.c.

const char* pcmk_strerror ( int  rc)
Deprecated:
Use standard return codes and pcmk_rc_str() instead

Definition at line 55 of file results.c.