DAOS API (v2.1 - dev)
Loading...
Searching...
No Matches
GURT

Macros

#define D_FOREACH_GURT_ERR(ACTION)
 
#define D_FOREACH_DAOS_ERR(ACTION)
 
#define D_FOREACH_ERR_RANGE(ACTION)
 
#define D_DEFINE_ERRNO(name, value, desc)   name = value,
 
#define D_DEFINE_ERRSTR(name, value, desc)   #name,
 
#define D_DEFINE_ERRDESC(name, value, desc)   #desc,
 
#define D_DEFINE_RANGE_ERRNO(name, base)
 
#define D_DEFINE_RANGE_ERRSTR(name)
 
#define D_REGISTER_RANGE(name)
 
#define D_DEREGISTER_RANGE(name)    d_errno_deregister_range(DER_ERR_##name##_BASE)
 
#define DER_SUCCESS   0
 
#define DER_UNKNOWN   (DER_ERR_GURT_BASE + 500000)
 

Functions

const char * d_errstr (int rc)
 
int d_errno_register_range (int start, int end, const char *const *error_strings, const char *const *strerror)
 
void d_errno_deregister_range (int start)
 
const char * d_errdesc (int errnum)
 

Detailed Description

(C) Copyright 2016-2023 Intel Corporation.

SPDX-License-Identifier: BSD-2-Clause-Patent DAOS Error numbers

Macro Definition Documentation

◆ D_DEFINE_ERRDESC

#define D_DEFINE_ERRDESC ( name,
value,
desc )   #desc,

Preprocessor machinery for defining error descriptions

Definition at line 269 of file daos_errno.h.

◆ D_DEFINE_ERRNO

#define D_DEFINE_ERRNO ( name,
value,
desc )   name = value,

Preprocessor machinery for defining error numbers

Definition at line 265 of file daos_errno.h.

◆ D_DEFINE_ERRSTR

#define D_DEFINE_ERRSTR ( name,
value,
desc )   #name,

Preprocessor machinery for defining error number strings

Definition at line 267 of file daos_errno.h.

◆ D_DEFINE_RANGE_ERRNO

#define D_DEFINE_RANGE_ERRNO ( name,
base )
Value:
enum { \
DER_ERR_##name##_BASE = (base), \
D_FOREACH_##name##_ERR(D_DEFINE_ERRNO) \
DER_ERR_##name##_LIMIT, \
};
#define D_DEFINE_ERRNO(name, value, desc)
Definition daos_errno.h:265

Preprocessor machinery to define a consecutive range of error numbers

Definition at line 272 of file daos_errno.h.

◆ D_DEFINE_RANGE_ERRSTR

#define D_DEFINE_RANGE_ERRSTR ( name)
Value:
static const char * const g_##name##_error_strings[] = {\
D_FOREACH_##name##_ERR(D_DEFINE_ERRSTR) \
}; \
static const char * const g_##name##_strerror[] = { \
D_FOREACH_##name##_ERR(D_DEFINE_ERRDESC) \
};
#define D_DEFINE_ERRDESC(name, value, desc)
Definition daos_errno.h:269
#define D_DEFINE_ERRSTR(name, value, desc)
Definition daos_errno.h:267

Preprocessor machinery to define error strings for a consecutive range of error numbers

Definition at line 280 of file daos_errno.h.

◆ D_DEREGISTER_RANGE

#define D_DEREGISTER_RANGE ( name)     d_errno_deregister_range(DER_ERR_##name##_BASE)

Macro to deregister a range defined using D_DEFINE_RANGE macros

Definition at line 298 of file daos_errno.h.

◆ D_FOREACH_DAOS_ERR

#define D_FOREACH_DAOS_ERR ( ACTION)

TODO: add more error numbers Preprocessor macro defining DAOS errno values and internal definition of d_errstr

Definition at line 168 of file daos_errno.h.

◆ D_FOREACH_ERR_RANGE

#define D_FOREACH_ERR_RANGE ( ACTION)
Value:
ACTION(GURT, 1000) \
ACTION(DAOS, 2000)

Defines the gurt error codes

Definition at line 260 of file daos_errno.h.

◆ D_FOREACH_GURT_ERR

#define D_FOREACH_GURT_ERR ( ACTION)

Preprocessor macro defining GURT errno values and internal definition of d_errstr

Definition at line 28 of file daos_errno.h.

◆ D_REGISTER_RANGE

#define D_REGISTER_RANGE ( name)
Value:
d_errno_register_range(DER_ERR_##name##_BASE, \
DER_ERR_##name##_LIMIT, \
g_##name##_error_strings,\
g_##name##_strerror)
int d_errno_register_range(int start, int end, const char *const *error_strings, const char *const *strerror)

Macro to register a range defined using D_DEFINE_RANGE macros

Definition at line 291 of file daos_errno.h.

◆ DER_SUCCESS

#define DER_SUCCESS   0

Return value representing success

Definition at line 302 of file daos_errno.h.

◆ DER_UNKNOWN

#define DER_UNKNOWN   (DER_ERR_GURT_BASE + 500000)

Unknown error

Definition at line 304 of file daos_errno.h.

Function Documentation

◆ d_errdesc()

const char * d_errdesc ( int errnum)

Return an error description string associated with a registered gurt errno.

Parameters
[in]errnumThe error code
Returns
The error description string, or an "Unknown error nnn" message if the error number is unknown.

◆ d_errno_deregister_range()

void d_errno_deregister_range ( int start)

De-register error codes with gurt. Use D_DEREGISTER_RANGE.

Parameters
[in]startStart of error range

◆ d_errno_register_range()

int d_errno_register_range ( int start,
int end,
const char *const * error_strings,
const char *const * strerror )

Register error codes with gurt. Use D_REGISTER_RANGE.

Parameters
[in]startStart of error range. Actual errors start at start + 1
[in]endEnd of range. All error codes should be less than end
[in]error_stringsArray of strings. Must be one per code in the range
[in]strerrorArray of strings. Must be one per code in the range
Returns
0 on success, otherwise error code

◆ d_errstr()

const char * d_errstr ( int rc)

Return a string associated with a registered gurt errno

Parameters
[in]rcThe error code
Returns
String value for error code or DER_UNKNOWN