diff options
author | Manuel Bentele | 2020-09-08 15:07:31 +0200 |
---|---|---|
committer | Manuel Bentele | 2020-09-16 07:37:56 +0200 |
commit | efc492d327ea6a9658674eb9e971aff3742818cd (patch) | |
tree | 72a3e3e61ee3cbc7df4059ee24ae95487c265b60 /utils/include/pidfd-utils.h | |
parent | Added file format file format subsystem for loop devices (diff) | |
download | xloop-efc492d327ea6a9658674eb9e971aff3742818cd.tar.gz xloop-efc492d327ea6a9658674eb9e971aff3742818cd.tar.xz xloop-efc492d327ea6a9658674eb9e971aff3742818cd.zip |
Added patched losetup utility to configure xloop devices
Diffstat (limited to 'utils/include/pidfd-utils.h')
-rw-r--r-- | utils/include/pidfd-utils.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/utils/include/pidfd-utils.h b/utils/include/pidfd-utils.h new file mode 100644 index 0000000..4a6c3a6 --- /dev/null +++ b/utils/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 */ |