Fix: get_cmdline_by_pid path length assumes a max pid of 65535
[lttng-tools.git] / include / lttng / constant.h
CommitLineData
1239a312
DG
1/*
2 * Copyright (C) 2014 - David Goulet <dgoulet@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18#ifndef LTTNG_CONSTANT_H
19#define LTTNG_CONSTANT_H
20
21#ifndef LTTNG_DEPRECATED
22#if defined (__GNUC__) \
23 && ((__GNUC_MAJOR__ == 4) && (__GNUC_MINOR__ >= 5) \
24 || __GNUC_MAJOR__ >= 5)
25#define LTTNG_DEPRECATED(msg) __attribute__((deprecated(msg)))
26#else
27#define LTTNG_DEPRECATED(msg) __attribute__((deprecated))
28#endif /* defined __GNUC__ */
29#endif /* LTTNG_DEPRECATED */
30
31#include <limits.h>
32/*
33 * Necessary to include the fixed width type limits on glibc versions older
34 * than 2.18 when building with a C++ compiler.
35 */
36#ifndef __STDC_LIMIT_MACROS
37#define __STDC_LIMIT_MACROS
38#include <stdint.h>
39#undef __STDC_LIMIT_MACROS
40#else /* #ifndef __STDC_LIMIT_MACROS */
41#include <stdint.h>
42#endif /* #else #ifndef __STDC_LIMIT_MACROS */
43#include <sys/types.h>
44
45/*
46 * Event symbol length. Copied from LTTng kernel ABI.
47 */
fae9a062
JG
48#define LTTNG_SYMBOL_NAME_LEN 256
49
50/*
51 * PROC(5) mentions that PID_MAX_LIMIT may not exceed 2^22 on 64-bit HW.
52 * We prefer to use 32-bits for simplicity's sake.
53 */
54#define LTTNG_MAX_PID INT32_MAX
55#define LTTNG_MAX_PID_STR "2147483647"
1239a312
DG
56
57#endif /* LTTNG_CONSTANT_H */
This page took 0.031963 seconds and 4 git commands to generate.