lxcfs/0014-fix-pidfd_open-pidfd_send_signal-function-compilatio.patch
vegbir 9cae669874 upgrade to 5.0.4
Signed-off-by: vegbir <yangjiaqi16@huawei.com>
2023-07-29 09:15:09 +00:00

38 lines
1.0 KiB
Diff

From 2c07195cd633c270ddcc6ef5349dbbc7063302d5 Mon Sep 17 00:00:00 2001
From: vegbir <yangjiaqi16@huawei.com>
Date: Sat, 15 Jul 2023 04:25:53 +0000
Subject: [PATCH 14/15] fix pidfd_open pidfd_send_signal function compilation
Signed-off-by: vegbir <yangjiaqi16@huawei.com>
---
src/utils.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/utils.h b/src/utils.h
index 7ed021a..5f19946 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -46,6 +46,9 @@ static inline int pidfd_open(pid_t pid, unsigned int flags)
{
return syscall(__NR_pidfd_open, pid, flags);
}
+#else
+#include <sys/pidfd.h>
+extern int pidfd_open(pid_t pid, unsigned int flags);
#endif
#if !HAVE_PIDFD_SEND_SIGNAL
@@ -54,6 +57,9 @@ static inline int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,
{
return syscall(__NR_pidfd_send_signal, pidfd, sig, info, flags);
}
+#else
+#include <sys/pidfd.h>
+extern int pidfd_send_signal(int pidfd, int sig, siginfo_t *info,unsigned int flags);
#endif
extern FILE *fopen_cached(const char *path, const char *mode,
--
2.41.0