| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright (C) 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE_COMPAT_LIMITS_H |
| 8 | #define BABELTRACE_COMPAT_LIMITS_H |
| 9 | |
| 10 | #include <limits.h> |
| 11 | |
| 12 | #ifdef __linux__ |
| 13 | |
| 14 | #define BABELTRACE_HOST_NAME_MAX HOST_NAME_MAX |
| 15 | |
| 16 | #elif defined(__FreeBSD__) |
| 17 | |
| 18 | #include <sys/param.h> |
| 19 | |
| 20 | #define BABELTRACE_HOST_NAME_MAX MAXHOSTNAMELEN |
| 21 | |
| 22 | #elif defined(_POSIX_HOST_NAME_MAX) |
| 23 | |
| 24 | #define BABELTRACE_HOST_NAME_MAX _POSIX_HOST_NAME_MAX |
| 25 | |
| 26 | #else |
| 27 | |
| 28 | #define BABELTRACE_HOST_NAME_MAX 256 |
| 29 | |
| 30 | #endif /* __linux__, __FreeBSD__, _POSIX_HOST_NAME_MAX */ |
| 31 | |
| 32 | /* GNU Hurd has no PATH_MAX, use a sensible default */ |
| 33 | #ifdef __GNU__ |
| 34 | #define PATH_MAX 4096 |
| 35 | #endif /* __GNU__ */ |
| 36 | |
| 37 | #endif /* BABELTRACE_COMPAT_LIMITS_H */ |