Commit | Line | Data |
---|---|---|
75018ab6 | 1 | /* |
90c106c6 | 2 | * Copyright (C) 2011 EfficiOS Inc. |
ab5be9fa | 3 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
75018ab6 | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: LGPL-2.1-only |
75018ab6 | 6 | * |
75018ab6 JG |
7 | */ |
8 | ||
ab5be9fa MJ |
9 | #ifndef _LTTNG_UST_ERROR_H |
10 | #define _LTTNG_UST_ERROR_H | |
11 | ||
75018ab6 JG |
12 | /* |
13 | * This header is meant for liblttng and libust internal use ONLY. | |
14 | * These declarations should NOT be considered stable API. | |
15 | */ | |
16 | ||
17 | #include <limits.h> | |
18 | #include <unistd.h> | |
19 | ||
20 | #include "lttng-ust-abi.h" | |
21 | ||
22 | /* | |
23 | * ustcomm error code. | |
24 | */ | |
25 | enum lttng_ust_error_code { | |
26 | LTTNG_UST_OK = 0, /* Ok */ | |
27 | LTTNG_UST_ERR = 1024, /* Unknown Error */ | |
28 | LTTNG_UST_ERR_NOENT = 1025, /* No entry */ | |
29 | LTTNG_UST_ERR_EXIST = 1026, /* Object exists */ | |
30 | LTTNG_UST_ERR_INVAL = 1027, /* Invalid argument */ | |
31 | LTTNG_UST_ERR_PERM = 1028, /* Permission denied */ | |
32 | LTTNG_UST_ERR_NOSYS = 1029, /* Not implemented */ | |
33 | LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */ | |
34 | ||
35 | LTTNG_UST_ERR_INVAL_MAGIC = 1031, /* Invalid magic number */ | |
36 | LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */ | |
37 | LTTNG_UST_ERR_UNSUP_MAJOR = 1033, /* Unsupported major version */ | |
38 | ||
39 | /* MUST be last element */ | |
40 | LTTNG_UST_ERR_NR, /* Last element */ | |
41 | }; | |
42 | ||
43 | /* | |
44 | * Return a human-readable error message for an lttng-ust error code. | |
45 | * code must be a positive value (or 0). | |
46 | */ | |
47 | extern const char *lttng_ust_strerror(int code); | |
48 | ||
49 | #endif /* _LTTNG_UST_ERROR_H */ |