src: implement REUSE with SPDX identifiers
[lttng-ust.git] / include / lttng / ust-error.h
CommitLineData
7bc53e94 1/*
c0c0989a 2 * SPDX-License-Identifier: LGPL-2.1-only
7bc53e94 3 *
2137460a 4 * Copyright (C) 2011 EfficiOS Inc.
c0c0989a 5 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7bc53e94
MD
6 */
7
c0c0989a
MJ
8#ifndef _LTTNG_UST_ERROR_H
9#define _LTTNG_UST_ERROR_H
10
7bc53e94
MD
11#include <limits.h>
12#include <unistd.h>
13#include <lttng/ust-abi.h>
14
6453d237
MD
15#ifdef __cplusplus
16extern "C" {
17#endif
18
7bc53e94
MD
19/*
20 * ustcomm error code.
21 */
22enum lttng_ust_error_code {
23 LTTNG_UST_OK = 0, /* Ok */
24 LTTNG_UST_ERR = 1024, /* Unknown Error */
64b2564e
DG
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 */
74d81a6c 30 LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */
7bc53e94 31
32ce8569
MD
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 */
a834901f
MD
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. */
32ce8569 37
7bc53e94
MD
38 /* MUST be last element */
39 LTTNG_UST_ERR_NR, /* Last element */
40};
41
42/*
d6d2eb79
MJ
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.
7bc53e94 48 */
828e8379 49const char *lttng_ust_strerror(int code);
7bc53e94 50
6453d237
MD
51#ifdef __cplusplus
52}
53#endif
54
7bc53e94 55#endif /* _LTTNG_UST_ERROR_H */
This page took 0.037709 seconds and 4 git commands to generate.