Fix: Use unix socket peercred for pid, uid, gid credentials
[lttng-ust.git] / include / lttng / ust-error.h
CommitLineData
7bc53e94
MD
1#ifndef _LTTNG_UST_ERROR_H
2#define _LTTNG_UST_ERROR_H
3
4/*
5 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
6 * Julien Desfossez <julien.desfossez@polymtl.ca>
7 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; only
12 * version 2.1 of the License.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24/*
25 * This header is meant for liblttng and libust internal use ONLY.
26 * These declarations should NOT be considered stable API.
27 */
28
29#include <limits.h>
30#include <unistd.h>
31#include <lttng/ust-abi.h>
32
6453d237
MD
33#ifdef __cplusplus
34extern "C" {
35#endif
36
7bc53e94
MD
37/*
38 * ustcomm error code.
39 */
40enum lttng_ust_error_code {
41 LTTNG_UST_OK = 0, /* Ok */
42 LTTNG_UST_ERR = 1024, /* Unknown Error */
64b2564e
DG
43 LTTNG_UST_ERR_NOENT = 1025, /* No entry */
44 LTTNG_UST_ERR_EXIST = 1026, /* Object exists */
45 LTTNG_UST_ERR_INVAL = 1027, /* Invalid argument */
46 LTTNG_UST_ERR_PERM = 1028, /* Permission denied */
47 LTTNG_UST_ERR_NOSYS = 1029, /* Not implemented */
74d81a6c 48 LTTNG_UST_ERR_EXITING = 1030, /* Process is exiting */
7bc53e94 49
32ce8569
MD
50 LTTNG_UST_ERR_INVAL_MAGIC = 1031, /* Invalid magic number */
51 LTTNG_UST_ERR_INVAL_SOCKET_TYPE = 1032, /* Invalid socket type */
52 LTTNG_UST_ERR_UNSUP_MAJOR = 1033, /* Unsupported major version */
a834901f
MD
53 LTTNG_UST_ERR_PEERCRED = 1034, /* Cannot get unix socket peer credentials */
54 LTTNG_UST_ERR_PEERCRED_PID = 1035, /* Peer credentials PID is invalid. Socket appears to belong to a distinct, non-nested pid namespace. */
32ce8569 55
7bc53e94
MD
56 /* MUST be last element */
57 LTTNG_UST_ERR_NR, /* Last element */
58};
59
60/*
61 * Return a human-readable error message for an lttng-ust error code.
62 * code must be a positive value (or 0).
63 */
64extern const char *lttng_ust_strerror(int code);
65
6453d237
MD
66#ifdef __cplusplus
67}
68#endif
69
7bc53e94 70#endif /* _LTTNG_UST_ERROR_H */
This page took 0.02989 seconds and 4 git commands to generate.