10#ifndef __DAOS_ERRNO_H__
11#define __DAOS_ERRNO_H__
13#if defined(__cplusplus)
28#define D_FOREACH_GURT_ERR(ACTION) \
30 ACTION(DER_NO_PERM, (DER_ERR_GURT_BASE + 1), \
31 Operation not permitted) \
33 ACTION(DER_NO_HDL, (DER_ERR_GURT_BASE + 2), \
36 ACTION(DER_INVAL, (DER_ERR_GURT_BASE + 3), \
39 ACTION(DER_EXIST, (DER_ERR_GURT_BASE + 4), \
40 Entity already exists) \
42 ACTION(DER_NONEXIST, (DER_ERR_GURT_BASE + 5), \
43 The specified entity does not exist) \
45 ACTION(DER_UNREACH, (DER_ERR_GURT_BASE + 6), \
48 ACTION(DER_NOSPACE, (DER_ERR_GURT_BASE + 7), \
49 No space on storage target) \
51 ACTION(DER_ALREADY, (DER_ERR_GURT_BASE + 8), \
52 Operation already performed) \
54 ACTION(DER_NOMEM, (DER_ERR_GURT_BASE + 9), \
57 ACTION(DER_NOSYS, (DER_ERR_GURT_BASE + 10), \
58 Function not implemented) \
60 ACTION(DER_TIMEDOUT, (DER_ERR_GURT_BASE + 11), \
63 ACTION(DER_BUSY, (DER_ERR_GURT_BASE + 12), \
64 Device or resource busy) \
66 ACTION(DER_AGAIN, (DER_ERR_GURT_BASE + 13), \
69 ACTION(DER_PROTO, (DER_ERR_GURT_BASE + 14), \
70 Incompatible protocol) \
72 ACTION(DER_UNINIT, (DER_ERR_GURT_BASE + 15), \
73 Device or resource not initialized) \
75 ACTION(DER_TRUNC, (DER_ERR_GURT_BASE + 16), \
78 ACTION(DER_OVERFLOW, (DER_ERR_GURT_BASE + 17), \
79 Data too long for defined data type or buffer size) \
81 ACTION(DER_CANCELED, (DER_ERR_GURT_BASE + 18), \
84 ACTION(DER_OOG, (DER_ERR_GURT_BASE + 19), \
85 Out of group or member list) \
87 ACTION(DER_HG, (DER_ERR_GURT_BASE + 20), \
88 Transport layer mercury error) \
90 ACTION(DER_UNREG, (DER_ERR_GURT_BASE + 21), \
91 RPC or protocol version not registered) \
93 ACTION(DER_ADDRSTR_GEN, (DER_ERR_GURT_BASE + 22), \
94 Failed to generate an address string) \
96 ACTION(DER_PMIX, (DER_ERR_GURT_BASE + 23), \
99 ACTION(DER_IVCB_FORWARD, (DER_ERR_GURT_BASE + 24), \
100 Incast variable unavailable locally. Must forward) \
102 ACTION(DER_MISC, (DER_ERR_GURT_BASE + 25), \
103 Miscellaneous error) \
105 ACTION(DER_BADPATH, (DER_ERR_GURT_BASE + 26), \
108 ACTION(DER_NOTDIR, (DER_ERR_GURT_BASE + 27), \
111 ACTION(DER_CORPC_INCOMPLETE, (DER_ERR_GURT_BASE + 28), \
112 Collective RPC failed) \
114 ACTION(DER_NO_RAS_RANK, (DER_ERR_GURT_BASE + 29), \
115 No rank is subscribed to RAS) \
117 ACTION(DER_NOTATTACH, (DER_ERR_GURT_BASE + 30), \
118 Service group not attached) \
120 ACTION(DER_MISMATCH, (DER_ERR_GURT_BASE + 31), \
123 ACTION(DER_EXCLUDED, (DER_ERR_GURT_BASE + 32), \
124 Rank has been excluded) \
126 ACTION(DER_NOREPLY, (DER_ERR_GURT_BASE + 33), \
127 User provided RPC handler did not send reply back) \
129 ACTION(DER_DOS, (DER_ERR_GURT_BASE + 34), \
132 ACTION(DER_BAD_TARGET, (DER_ERR_GURT_BASE + 35), \
133 Incorrect target for the RPC) \
135 ACTION(DER_GRPVER, (DER_ERR_GURT_BASE + 36), \
136 Group versioning mismatch) \
138 ACTION(DER_HLC_SYNC, (DER_ERR_GURT_BASE + 37), \
139 HLC synchronization error) \
141 ACTION(DER_NO_SHMEM, (DER_ERR_GURT_BASE + 38), \
142 Not enough shared memory free) \
144 ACTION(DER_ADD_METRIC_FAILED, (DER_ERR_GURT_BASE + 39), \
145 Failed to add the specified metric) \
147 ACTION(DER_DURATION_MISMATCH, (DER_ERR_GURT_BASE + 40), \
148 Duration end not paired with duration start) \
150 ACTION(DER_OP_NOT_PERMITTED, (DER_ERR_GURT_BASE + 41), \
151 Operation not permitted for metric type provided) \
153 ACTION(DER_EXCEEDS_PATH_LEN, (DER_ERR_GURT_BASE + 42), \
154 Path name exceeds permitted length) \
156 ACTION(DER_METRIC_NOT_FOUND, (DER_ERR_GURT_BASE + 43), \
157 Read failed because metric not found) \
159 ACTION(DER_SHMEM_PERMS, (DER_ERR_GURT_BASE + 44), \
160 Unable to access shared memory segment due to \
161 incompatible user or group permissions) \
163 ACTION(DER_HG_FATAL, (DER_ERR_GURT_BASE + 45), \
164 Fatal transport layer mercury error)
168#define D_FOREACH_DAOS_ERR(ACTION) \
170 ACTION(DER_IO, (DER_ERR_DAOS_BASE + 1), I / O error) \
172 ACTION(DER_FREE_MEM, (DER_ERR_DAOS_BASE + 2), Memory free error) \
174 ACTION(DER_ENOENT, (DER_ERR_DAOS_BASE + 3), Entity not found) \
176 ACTION(DER_NOTYPE, (DER_ERR_DAOS_BASE + 4), Unknown object type) \
178 ACTION(DER_NOSCHEMA, (DER_ERR_DAOS_BASE + 5), Unknown object schema) \
180 ACTION(DER_NOLOCAL, (DER_ERR_DAOS_BASE + 6), Object is not local) \
182 ACTION(DER_STALE, (DER_ERR_DAOS_BASE + 7), Stale pool map version) \
184 ACTION(DER_NOTLEADER, (DER_ERR_DAOS_BASE + 8), Not service leader) \
186 ACTION(DER_TGT_CREATE, (DER_ERR_DAOS_BASE + 9), Target create error) \
188 ACTION(DER_EP_RO, (DER_ERR_DAOS_BASE + 10), Epoch is read only) \
190 ACTION(DER_EP_OLD, (DER_ERR_DAOS_BASE + 11), Epoch is too old.All data have been recycled) \
192 ACTION(DER_KEY2BIG, (DER_ERR_DAOS_BASE + 12), Key is too large) \
194 ACTION(DER_REC2BIG, (DER_ERR_DAOS_BASE + 13), Record is too large) \
196 ACTION(DER_IO_INVAL, (DER_ERR_DAOS_BASE + 14), I / O buffers do not match object extents) \
198 ACTION(DER_EQ_BUSY, (DER_ERR_DAOS_BASE + 15), Event queue is busy) \
200 ACTION(DER_DOMAIN, (DER_ERR_DAOS_BASE + 16), Domain of cluster component do not match) \
202 ACTION(DER_SHUTDOWN, (DER_ERR_DAOS_BASE + 17), Service should shut down) \
204 ACTION(DER_INPROGRESS, (DER_ERR_DAOS_BASE + 18), Operation now in progress) \
206 ACTION(DER_NOTAPPLICABLE, (DER_ERR_DAOS_BASE + 19), Not applicable) \
208 ACTION(DER_NOTREPLICA, (DER_ERR_DAOS_BASE + 20), Not a service replica) \
210 ACTION(DER_CSUM, (DER_ERR_DAOS_BASE + 21), Checksum error) \
212 ACTION(DER_DF_INVAL, (DER_ERR_DAOS_BASE + 22), Unsupported durable format) \
214 ACTION(DER_DF_INCOMPT, (DER_ERR_DAOS_BASE + 23), Incompatible durable format version) \
216 ACTION(DER_REC_SIZE, (DER_ERR_DAOS_BASE + 24), Record size error) \
218 ACTION(DER_TX_RESTART, (DER_ERR_DAOS_BASE + 25), Transaction should restart) \
220 ACTION(DER_DATA_LOSS, (DER_ERR_DAOS_BASE + 26), Data lost or not recoverable) \
222 ACTION(DER_OP_CANCELED, (DER_ERR_DAOS_BASE + 27), Operation canceled) \
224 ACTION(DER_TX_BUSY, (DER_ERR_DAOS_BASE + 28), TX is not committed) \
226 ACTION(DER_AGENT_INCOMPAT, (DER_ERR_DAOS_BASE + 29), Agent is incompatible with libdaos) \
228 ACTION(DER_NEED_TX, (DER_ERR_DAOS_BASE + 30), To be handled via distributed transaction) \
230 ACTION(DER_RF, (DER_ERR_DAOS_BASE + 31), Failures exceed RF) \
232 ACTION(DER_FETCH_AGAIN, (DER_ERR_DAOS_BASE + 32), Fetch again) \
234 ACTION(DER_TX_UNCERTAIN, (DER_ERR_DAOS_BASE + 33), TX status is uncertain) \
236 ACTION(DER_AGENT_COMM, (DER_ERR_DAOS_BASE + 34), Agent communication error) \
238 ACTION(DER_ID_MISMATCH, (DER_ERR_DAOS_BASE + 35), ID mismatch) \
240 ACTION(DER_TGT_RETRY, (DER_ERR_DAOS_BASE + 36), Retry with other target) \
241 ACTION(DER_NOTSUPPORTED, (DER_ERR_DAOS_BASE + 37), Operation not supported) \
242 ACTION(DER_CONTROL_INCOMPAT, (DER_ERR_DAOS_BASE + 38), \
243 One or more control plane components are incompatible) \
245 ACTION(DER_NO_SERVICE, (DER_ERR_DAOS_BASE + 39), No service available) \
247 ACTION(DER_TX_ID_REUSED, (DER_ERR_DAOS_BASE + 40), TX ID may be reused) \
249 ACTION(DER_UPDATE_AGAIN, (DER_ERR_DAOS_BASE + 41), update again) \
250 ACTION(DER_NVME_IO, (DER_ERR_DAOS_BASE + 42), NVMe I / O error) \
251 ACTION(DER_NO_CERT, (DER_ERR_DAOS_BASE + 43), Unable to access one or more certificates) \
252 ACTION(DER_BAD_CERT, (DER_ERR_DAOS_BASE + 44), Invalid x509 certificate) \
253 ACTION(DER_VOS_PARTIAL_UPDATE, (DER_ERR_DAOS_BASE + 45), \
254 Same epoch partial overwrite of VOS array value disallowed) \
255 ACTION(DER_CHKPT_BUSY, (DER_ERR_DAOS_BASE + 46), \
256 Page is temporarily read only due to checkpointing) \
257 ACTION(DER_DIV_BY_ZERO, (DER_ERR_DAOS_BASE + 47), Division by zero)
260#define D_FOREACH_ERR_RANGE(ACTION) \
265#define D_DEFINE_ERRNO(name, value, desc) name = value,
267#define D_DEFINE_ERRSTR(name, value, desc) #name,
269#define D_DEFINE_ERRDESC(name, value, desc) #desc,
272#define D_DEFINE_RANGE_ERRNO(name, base) \
274 DER_ERR_##name##_BASE = (base), \
275 D_FOREACH_##name##_ERR(D_DEFINE_ERRNO) \
276 DER_ERR_##name##_LIMIT, \
280#define D_DEFINE_RANGE_ERRSTR(name) \
281 static const char * const g_##name##_error_strings[] = {\
282 D_FOREACH_##name##_ERR(D_DEFINE_ERRSTR) \
284 static const char * const g_##name##_strerror[] = { \
285 D_FOREACH_##name##_ERR(D_DEFINE_ERRDESC) \
291#define D_REGISTER_RANGE(name) \
292 d_errno_register_range(DER_ERR_##name##_BASE, \
293 DER_ERR_##name##_LIMIT, \
294 g_##name##_error_strings,\
298#define D_DEREGISTER_RANGE(name) \
299 d_errno_deregister_range(DER_ERR_##name##_BASE)
304#define DER_UNKNOWN (DER_ERR_GURT_BASE + 500000)
328 const char *
const *error_strings,
329 const char *
const *strerror);
349#define DO_PRAGMA(str) _Pragma(#str)
350#define DEPRECATE_ERROR(olde, newe) \
352 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
355#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
358#define DF_RC "%s(%d): '%s'"
359#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
362#if defined(__cplusplus)
const char * d_errstr(int rc)
const char * d_errdesc(int errnum)
void d_errno_deregister_range(int start)
int d_errno_register_range(int start, int end, const char *const *error_strings, const char *const *strerror)
#define D_FOREACH_ERR_RANGE(ACTION)
#define D_DEFINE_RANGE_ERRNO(name, base)