[RFC PATCH kvmtool v1 19/32] Add memfd_restricted system call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This enables building kvmtool on a host that doesn't have the
kernel with the new extensions yet.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@xxxxxxxxxx>
---
 util/util.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/util/util.c b/util/util.c
index 1f2e1a6..1424815 100644
--- a/util/util.c
+++ b/util/util.c
@@ -10,6 +10,17 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
+#include <sys/syscall.h>
+
+#ifndef __NR_memfd_restricted
+#define __NR_memfd_restricted 451
+__SYSCALL(__NR_memfd_restricted, sys_memfd_restricted)
+#endif
+
+static inline int memfd_restricted(unsigned int flags)
+{
+	return syscall(__NR_memfd_restricted, flags);
+}
 
 static void report(const char *prefix, const char *err, va_list params)
 {
-- 
2.39.0.rc0.267.gcb52ba06e7-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux