summaryrefslogtreecommitdiffstats
path: root/kexec/kexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r--kexec/kexec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index fdb4c984..08edfca2 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -31,6 +31,10 @@
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
+#ifndef HAVE_MEMFD_CREATE
+#include <linux/memfd.h>
+#include <sys/syscall.h>
+#endif
#include <sys/reboot.h>
#include <sys/mman.h>
#include <unistd.h>
@@ -640,6 +644,13 @@ char *slurp_decompress_file(const char *filename, off_t *r_size)
return kernel_buf;
}
+#ifndef HAVE_MEMFD_CREATE
+static int memfd_create(const char *name, unsigned int flags)
+{
+ return syscall(SYS_memfd_create, name, flags);
+}
+#endif
+
static int copybuf_memfd(const char *kernel_buf, size_t size)
{
int fd, count;