| 1 | /* |
| 2 | * SPDX-License-Identifier: LGPL-2.1-only |
| 3 | * |
| 4 | * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LTTNG_NS_H |
| 8 | #define _LTTNG_NS_H |
| 9 | |
| 10 | /* |
| 11 | * The lowest valid inode number that can be allocated in the proc filesystem |
| 12 | * is 0xF0000000. Any number below can be used internally as an error code. |
| 13 | * |
| 14 | * Zero is used in the kernel as an error code, it's the value we will return |
| 15 | * when we fail to read the proper inode number. |
| 16 | * |
| 17 | * One is used internally to identify an uninitialized cache entry, it should |
| 18 | * never be returned. |
| 19 | */ |
| 20 | |
| 21 | enum ns_ino_state { |
| 22 | NS_INO_UNAVAILABLE = 0x0, |
| 23 | NS_INO_UNINITIALIZED = 0x1, |
| 24 | NS_INO_MIN = 0xF0000000, |
| 25 | }; |
| 26 | |
| 27 | /* |
| 28 | * The longest possible namespace proc path is with the cgroup ns |
| 29 | * and the maximum theoretical linux pid of 536870912 : |
| 30 | * |
| 31 | * /proc/self/task/536870912/ns/cgroup |
| 32 | */ |
| 33 | #define LTTNG_PROC_NS_PATH_MAX 40 |
| 34 | |
| 35 | #endif /* _LTTNG_NS_H */ |