diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:14:44 +0000 |
commit | 30ff6afe596eddafacf22b1a5b2d1a3d6254ea15 (patch) | |
tree | 9b788335f92174baf7ee18f03ca8330b8c19ce2b /include/pidfd-utils.h | |
parent | Initial commit. (diff) | |
download | util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.tar.xz util-linux-30ff6afe596eddafacf22b1a5b2d1a3d6254ea15.zip |
Adding upstream version 2.36.1.upstream/2.36.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/pidfd-utils.h')
-rw-r--r-- | include/pidfd-utils.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/pidfd-utils.h b/include/pidfd-utils.h new file mode 100644 index 0000000..4a6c3a6 --- /dev/null +++ b/include/pidfd-utils.h @@ -0,0 +1,28 @@ +#ifndef UTIL_LINUX_PIDFD_UTILS +#define UTIL_LINUX_PIDFD_UTILS + +#if defined(__linux__) +# include <sys/syscall.h> +# if defined(SYS_pidfd_send_signal) && defined(SYS_pidfd_open) +# include <sys/types.h> + +# ifndef HAVE_PIDFD_SEND_SIGNAL +static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info, + unsigned int flags) +{ + return syscall(SYS_pidfd_send_signal, pidfd, sig, info, flags); +} +# endif + +# ifndef HAVE_PIDFD_OPEN +static inline int pidfd_open(pid_t pid, unsigned int flags) +{ + return syscall(SYS_pidfd_open, pid, flags); +} +# endif + +# define UL_HAVE_PIDFD 1 + +# endif /* SYS_pidfd_send_signal */ +#endif /* __linux__ */ +#endif /* UTIL_LINUX_PIDFD_UTILS */ |