Commit | Line | Data |
---|---|---|
7bc53e94 | 1 | /* |
c0c0989a | 2 | * SPDX-License-Identifier: LGPL-2.1-only |
7bc53e94 | 3 | * |
c0c0989a MJ |
4 | * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca> |
5 | * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca> | |
6 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
7bc53e94 MD |
7 | */ |
8 | ||
9 | /* | |
10 | * This header is meant for liblttng and libust internal use ONLY. | |
11 | * These declarations should NOT be considered stable API. | |
12 | */ | |
13 | ||
c0c0989a MJ |
14 | #ifndef _LTTNG_UST_ERROR_H |
15 | #define _LTTNG_UST_ERROR_H | |
16 | ||
7bc53e94 MD |
17 | #include <limits.h> |
18 | #include <unistd.h> | |
19 | #include <lttng/ust-abi.h> | |
20 | ||
6453d237 MD |
21 | #ifdef __cplusplus |
22 | extern "C" { | |
23 | #endif | |
24 | ||
7bc53e94 MD |
25 | /* |
26 | * ustcomm error code. | |
27 | */ | |
28 | enum lttng_ust_error_code { | |
29 | LTTNG_UST_OK = 0, /* Ok */ | |
30 | LTTNG_UST_ERR = 1024, /* Unknown Error */ | |
64b2564e DG |
31 | LTTNG_UST_ERR_NOENT = 1025, /* No entry */ |
32 | LTTNG_UST_ERR_EXIST = 1026, /* Object exists */ | |
33 | LTTNG_UST_ERR_INVAL = 1027, /* Invalid argument */ | |
34 | LTTNG_UST_ERR_PERM = 1028, /* Permission denied */ | |
35 | LTTNG_UST_ERR_NOSYS = 1029, /* Not implemented */ | |
74d81a6c | 36 | LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */ |
7bc53e94 | 37 | |
32ce8569 MD |
38 | LTTNG_UST_ERR_INVAL_MAGIC = 1031, /* Invalid magic number */ |
39 | LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */ | |
40 | LTTNG_UST_ERR_UNSUP_MAJOR = 1033, /* Unsupported major version */ | |
a834901f MD |
41 | LTTNG_UST_ERR_PEERCRED = 1034, /* Cannot get unix socket peer credentials */ |
42 | LTTNG_UST_ERR_PEERCRED_PID = 1035, /* Peer credentials PID is invalid. Socket appears to belong to a distinct, non-nested pid namespace. */ | |
32ce8569 | 43 | |
7bc53e94 MD |
44 | /* MUST be last element */ |
45 | LTTNG_UST_ERR_NR, /* Last element */ | |
46 | }; | |
47 | ||
48 | /* | |
49 | * Return a human-readable error message for an lttng-ust error code. | |
50 | * code must be a positive value (or 0). | |
51 | */ | |
52 | extern const char *lttng_ust_strerror(int code); | |
53 | ||
6453d237 MD |
54 | #ifdef __cplusplus |
55 | } | |
56 | #endif | |
57 | ||
7bc53e94 | 58 | #endif /* _LTTNG_UST_ERROR_H */ |