libc: memfd_create should create /tmp/memfd/ before creating file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
43f9abf84f
commit
1a06f7a2c9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user