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), \
173 ACTION(DER_FREE_MEM, (DER_ERR_DAOS_BASE + 2), \
176 ACTION(DER_ENOENT, (DER_ERR_DAOS_BASE + 3), \
179 ACTION(DER_NOTYPE, (DER_ERR_DAOS_BASE + 4), \
180 Unknown object type) \
182 ACTION(DER_NOSCHEMA, (DER_ERR_DAOS_BASE + 5), \
183 Unknown object schema) \
185 ACTION(DER_NOLOCAL, (DER_ERR_DAOS_BASE + 6), \
186 Object is not local) \
188 ACTION(DER_STALE, (DER_ERR_DAOS_BASE + 7), \
189 Stale pool map version) \
191 ACTION(DER_NOTLEADER, (DER_ERR_DAOS_BASE + 8), \
192 Not service leader) \
194 ACTION(DER_TGT_CREATE, (DER_ERR_DAOS_BASE + 9), \
195 Target create error) \
197 ACTION(DER_EP_RO, (DER_ERR_DAOS_BASE + 10), \
198 Epoch is read only) \
200 ACTION(DER_EP_OLD, (DER_ERR_DAOS_BASE + 11), \
201 Epoch is too old. All data have been recycled) \
203 ACTION(DER_KEY2BIG, (DER_ERR_DAOS_BASE + 12), \
206 ACTION(DER_REC2BIG, (DER_ERR_DAOS_BASE + 13), \
207 Record is too large) \
209 ACTION(DER_IO_INVAL, (DER_ERR_DAOS_BASE + 14), \
210 I/O buffers do not match object extents) \
212 ACTION(DER_EQ_BUSY, (DER_ERR_DAOS_BASE + 15), \
213 Event queue is busy) \
215 ACTION(DER_DOMAIN, (DER_ERR_DAOS_BASE + 16), \
216 Domain of cluster component do not match) \
218 ACTION(DER_SHUTDOWN, (DER_ERR_DAOS_BASE + 17), \
219 Service should shut down) \
221 ACTION(DER_INPROGRESS, (DER_ERR_DAOS_BASE + 18), \
222 Operation now in progress) \
224 ACTION(DER_NOTAPPLICABLE, (DER_ERR_DAOS_BASE + 19), \
227 ACTION(DER_NOTREPLICA, (DER_ERR_DAOS_BASE + 20), \
228 Not a service replica) \
230 ACTION(DER_CSUM, (DER_ERR_DAOS_BASE + 21), \
233 ACTION(DER_DF_INVAL, (DER_ERR_DAOS_BASE + 22), \
234 Unsupported durable format) \
236 ACTION(DER_DF_INCOMPT, (DER_ERR_DAOS_BASE + 23), \
237 Incompatible durable format version) \
239 ACTION(DER_REC_SIZE, (DER_ERR_DAOS_BASE + 24), \
242 ACTION(DER_TX_RESTART, (DER_ERR_DAOS_BASE + 25), \
243 Transaction should restart) \
245 ACTION(DER_DATA_LOSS, (DER_ERR_DAOS_BASE + 26), \
246 Data lost or not recoverable) \
248 ACTION(DER_OP_CANCELED, (DER_ERR_DAOS_BASE + 27), \
249 Operation canceled) \
251 ACTION(DER_TX_BUSY, (DER_ERR_DAOS_BASE + 28), \
252 TX is not committed) \
254 ACTION(DER_AGENT_INCOMPAT, (DER_ERR_DAOS_BASE + 29), \
255 Agent is incompatible with libdaos) \
257 ACTION(DER_NEED_TX, (DER_ERR_DAOS_BASE + 30), \
258 To be handled via distributed transaction) \
260 ACTION(DER_RF, (DER_ERR_DAOS_BASE + 31), \
261 Failures exceed RF) \
263 ACTION(DER_FETCH_AGAIN, (DER_ERR_DAOS_BASE + 32), \
266 ACTION(DER_TX_UNCERTAIN, (DER_ERR_DAOS_BASE + 33), \
267 TX status is uncertaion) \
269 ACTION(DER_AGENT_COMM, (DER_ERR_DAOS_BASE + 34), \
270 Agent communication error) \
272 ACTION(DER_ID_MISMATCH, (DER_ERR_DAOS_BASE + 35), \
275 ACTION(DER_TGT_RETRY, (DER_ERR_DAOS_BASE + 36), \
276 Retry with other target) \
277 ACTION(DER_NOTSUPPORTED, (DER_ERR_DAOS_BASE + 37), \
278 Operation not supported) \
279 ACTION(DER_CONTROL_INCOMPAT, (DER_ERR_DAOS_BASE + 38), \
280 One or more control plane components are incompatible) \
282 ACTION(DER_NO_SERVICE, (DER_ERR_DAOS_BASE + 39), \
283 No service available) \
285 ACTION(DER_TX_ID_REUSED, (DER_ERR_DAOS_BASE + 40), \
286 TX ID may be reused) \
288 ACTION(DER_UPDATE_AGAIN, (DER_ERR_DAOS_BASE + 41), \
292#define D_FOREACH_ERR_RANGE(ACTION) \
297#define D_DEFINE_ERRNO(name, value, desc) name = value,
299#define D_DEFINE_ERRSTR(name, value, desc) #name,
301#define D_DEFINE_ERRDESC(name, value, desc) #desc,
304#define D_DEFINE_RANGE_ERRNO(name, base) \
306 DER_ERR_##name##_BASE = (base), \
307 D_FOREACH_##name##_ERR(D_DEFINE_ERRNO) \
308 DER_ERR_##name##_LIMIT, \
312#define D_DEFINE_RANGE_ERRSTR(name) \
313 static const char * const g_##name##_error_strings[] = {\
314 D_FOREACH_##name##_ERR(D_DEFINE_ERRSTR) \
316 static const char * const g_##name##_strerror[] = { \
317 D_FOREACH_##name##_ERR(D_DEFINE_ERRDESC) \
323#define D_REGISTER_RANGE(name) \
324 d_errno_register_range(DER_ERR_##name##_BASE, \
325 DER_ERR_##name##_LIMIT, \
326 g_##name##_error_strings,\
330#define D_DEREGISTER_RANGE(name) \
331 d_errno_deregister_range(DER_ERR_##name##_BASE)
336#define DER_UNKNOWN (DER_ERR_GURT_BASE + 500000)
360 const char *
const *error_strings,
361 const char *
const *strerror);
381#define DO_PRAGMA(str) _Pragma(#str)
382#define DEPRECATE_ERROR(olde, newe) \
384 DO_PRAGMA(message(#olde " is deprecated, use " #newe)); \
387#define DER_EVICTED DEPRECATE_ERROR(DER_EVICTED, DER_EXCLUDED)
390#define DF_RC "%s(%d): '%s'"
391#define DP_RC(rc) d_errstr(rc), rc, d_errdesc(rc)
394#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)