Commit Graph

7 Commits

Author SHA1 Message Date
hujun5
99eeaafd07 lib_memfd: turn a runtime error into a linker error
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-11 23:39:37 +08:00
Xiang Xiao
aa0b3fcdf9 lib/memfd: shm_unlink or unlink anonymous file
https://man7.org/linux/man-pages/man2/memfd_create.2.html:
       The name supplied in name is used as a filename and will be
       displayed as the target of the corresponding symbolic link in the
       directory /proc/self/fd/.  The displayed name is always prefixed
       with memfd: and serves only for debugging purposes.  Names do not
       affect the behavior of the file descriptor, and as such multiple
       files can have the same name without any side effects.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-06 20:02:30 -04:00
Xiang Xiao
1a06f7a2c9 libc: memfd_create should create /tmp/memfd/ before creating file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-20 20:14:20 +03:00
Xiang Xiao
43f9abf84f libc: Prefer to implement memfd on top of shm
since shm can work in protected and kernel mode too

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-20 20:14:20 +03:00
Xiang Xiao
dc2e9b8771 libc: Move memfd related stuff to sys/mman.h
follow the freebsd definition:
https://github.com/freebsd/freebsd-src/blob/master/sys/sys/mman.h#L207-L228

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-13 16:00:37 +01:00
Xiang Xiao
8df223a1ef libc: Add LIBC prefix to MEM_FD_VFS_PATH
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-20 16:21:06 +08:00
Xiang Xiao
fa2e1897ea libc: Implement memfd on top of tmpfs
https://man7.org/linux/man-pages/man2/memfd_create.2.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-08-09 22:13:09 +03:00