linux-user: add memfd_create

Add support for the memfd_create syscall. If the host does not have the
libc wrapper, translate to a direct syscall with NC-macro.

Buglink: https://bugs.launchpad.net/qemu/+bug/1734792
Signed-off-by: Shu-Chun Weng <scw@google.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190819180947.180725-1-scw@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Shu-Chun Weng 2019-08-19 11:09:47 -07:00 committed by Laurent Vivier
parent 7f4341e84b
commit 9bdfa4d23f
3 changed files with 17 additions and 1 deletions

View file

@ -32,6 +32,10 @@
#define MFD_HUGE_SHIFT 26
#endif
#if defined CONFIG_LINUX && !defined CONFIG_MEMFD
int memfd_create(const char *name, unsigned int flags);
#endif
int qemu_memfd_create(const char *name, size_t size, bool hugetlb,
uint64_t hugetlbsize, unsigned int seals, Error **errp);
bool qemu_memfd_alloc_check(void);