Commit e8842cf0 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Paul E. McKenney

tools/nolibc: add wrapper for memfd_create

This is useful for users and will also be used by a future testcase.
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent fc82d7db
...@@ -1365,6 +1365,29 @@ ssize_t write(int fd, const void *buf, size_t count) ...@@ -1365,6 +1365,29 @@ ssize_t write(int fd, const void *buf, size_t count)
return ret; return ret;
} }
/*
* int memfd_create(const char *name, unsigned int flags);
*/
static __attribute__((unused))
int sys_memfd_create(const char *name, unsigned int flags)
{
return my_syscall2(__NR_memfd_create, name, flags);
}
static __attribute__((unused))
int memfd_create(const char *name, unsigned int flags)
{
ssize_t ret = sys_memfd_create(name, flags);
if (ret < 0) {
SET_ERRNO(-ret);
ret = -1;
}
return ret;
}
/* make sure to include all global symbols */ /* make sure to include all global symbols */
#include "nolibc.h" #include "nolibc.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment