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