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