Commit | Line | Data |
---|---|---|
e1055edb | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
e1055edb | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: GPL-2.0-only |
e1055edb | 5 | * |
e1055edb JG |
6 | */ |
7 | ||
8 | #ifndef _COMPAT_PRCTL_H | |
9 | #define _COMPAT_PRCTL_H | |
10 | ||
11 | #ifdef __linux__ | |
12 | #include <sys/prctl.h> | |
13 | ||
14 | static inline | |
15 | int lttng_prctl(int option, unsigned long arg2, unsigned long arg3, | |
16 | unsigned long arg4, unsigned long arg5) | |
17 | { | |
18 | return prctl(option, arg2, arg3, arg4, arg5); | |
19 | } | |
20 | ||
21 | #else | |
22 | ||
23 | #ifndef PR_SET_NAME | |
24 | #define PR_SET_NAME 0 | |
25 | #endif /* PR_SET_NAME */ | |
26 | ||
27 | static inline | |
28 | int lttng_prctl(int option, unsigned long arg2, unsigned long arg3, | |
29 | unsigned long arg4, unsigned long arg5) | |
30 | { | |
31 | return -ENOSYS; | |
32 | } | |
33 | ||
34 | #endif /* __linux__ */ | |
35 | ||
36 | #endif /* _COMPAT_PRCTL_H */ |