This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1a06f7a2c9d738a146f2f5f28d91e2229707df7d
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sun Jun 11 23:55:51 2023 +0800

    libc: memfd_create should create /tmp/memfd/ before creating file
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 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 <sys/mman.h>
+#include <sys/stat.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
@@ -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

Reply via email to