Commit | Line | Data |
---|---|---|
1c196845 MJ |
1 | // SPDX-FileCopyrightText: 2011 EfficiOS Inc. |
2 | // SPDX-FileCopyrightText: 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
3 | // | |
4 | // SPDX-License-Identifier: LGPL-2.1-only | |
7bc53e94 | 5 | |
c0c0989a MJ |
6 | #ifndef _LTTNG_UST_ERROR_H |
7 | #define _LTTNG_UST_ERROR_H | |
8 | ||
7bc53e94 MD |
9 | #include <limits.h> |
10 | #include <unistd.h> | |
11 | #include <lttng/ust-abi.h> | |
12 | ||
6453d237 MD |
13 | #ifdef __cplusplus |
14 | extern "C" { | |
15 | #endif | |
16 | ||
7bc53e94 MD |
17 | /* |
18 | * ustcomm error code. | |
19 | */ | |
20 | enum lttng_ust_error_code { | |
21 | LTTNG_UST_OK = 0, /* Ok */ | |
22 | LTTNG_UST_ERR = 1024, /* Unknown Error */ | |
64b2564e DG |
23 | LTTNG_UST_ERR_NOENT = 1025, /* No entry */ |
24 | LTTNG_UST_ERR_EXIST = 1026, /* Object exists */ | |
25 | LTTNG_UST_ERR_INVAL = 1027, /* Invalid argument */ | |
26 | LTTNG_UST_ERR_PERM = 1028, /* Permission denied */ | |
27 | LTTNG_UST_ERR_NOSYS = 1029, /* Not implemented */ | |
74d81a6c | 28 | LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */ |
7bc53e94 | 29 | |
32ce8569 MD |
30 | LTTNG_UST_ERR_INVAL_MAGIC = 1031, /* Invalid magic number */ |
31 | LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */ | |
32 | LTTNG_UST_ERR_UNSUP_MAJOR = 1033, /* Unsupported major version */ | |
a834901f MD |
33 | LTTNG_UST_ERR_PEERCRED = 1034, /* Cannot get unix socket peer credentials */ |
34 | LTTNG_UST_ERR_PEERCRED_PID = 1035, /* Peer credentials PID is invalid. Socket appears to belong to a distinct, non-nested pid namespace. */ | |
32ce8569 | 35 | |
7bc53e94 MD |
36 | /* MUST be last element */ |
37 | LTTNG_UST_ERR_NR, /* Last element */ | |
38 | }; | |
39 | ||
40 | /* | |
d6d2eb79 MJ |
41 | * lttng_ust_strerror |
42 | * @code: must be a negative value of enum lttng_ust_error_code (or 0). | |
43 | * | |
44 | * Returns a ptr to a string representing a human readable error code from the | |
45 | * ustcomm_return_code enum. | |
7bc53e94 | 46 | */ |
828e8379 | 47 | const char *lttng_ust_strerror(int code); |
7bc53e94 | 48 | |
6453d237 MD |
49 | #ifdef __cplusplus |
50 | } | |
51 | #endif | |
52 | ||
7bc53e94 | 53 | #endif /* _LTTNG_UST_ERROR_H */ |