From 1a06f7a2c9d738a146f2f5f28d91e2229707df7d Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 11 Jun 2023 23:55:51 +0800 Subject: [PATCH] libc: memfd_create should create /tmp/memfd/ before creating file Signed-off-by: Xiang Xiao --- libs/libc/misc/lib_memfd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/libc/misc/lib_memfd.c b/libs/libc/misc/lib_memfd.c index 828874d7fc..98db24fa43 100644 --- a/libs/libc/misc/lib_memfd.c +++ b/libs/libc/misc/lib_memfd.c @@ -23,6 +23,7 @@ ****************************************************************************/ #include +#include #include #include #include @@ -56,6 +57,7 @@ int memfd_create(FAR const char *name, unsigned int flags) # ifdef CONFIG_LIBC_MEMFD_SHMFS return shm_open(path, O_RDWR | flags, 0660); # else + mkdir(LIBC_MEM_FD_VFS_PATH, 0666); return open(path, O_RDWR | flags, 0660); # endif #endif