Hou Tao | c710136 | 2022-09-01 14:19:37 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __TASK_LOCAL_STORAGE_HELPER_H |
| 3 | #define __TASK_LOCAL_STORAGE_HELPER_H |
| 4 | |
| 5 | #include <unistd.h> |
| 6 | #include <sys/syscall.h> |
| 7 | #include <sys/types.h> |
| 8 | |
| 9 | #ifndef __NR_pidfd_open |
Hou Tao | 62c69e8 | 2022-10-11 15:12:49 +0800 | [diff] [blame] | 10 | #ifdef __alpha__ |
| 11 | #define __NR_pidfd_open 544 |
| 12 | #else |
Hou Tao | c710136 | 2022-09-01 14:19:37 +0800 | [diff] [blame] | 13 | #define __NR_pidfd_open 434 |
| 14 | #endif |
Hou Tao | 62c69e8 | 2022-10-11 15:12:49 +0800 | [diff] [blame] | 15 | #endif |
Hou Tao | c710136 | 2022-09-01 14:19:37 +0800 | [diff] [blame] | 16 | |
| 17 | static inline int sys_pidfd_open(pid_t pid, unsigned int flags) |
| 18 | { |
| 19 | return syscall(__NR_pidfd_open, pid, flags); |
| 20 | } |
| 21 | |
| 22 | #endif |