memfd_create() creates an anonymous fileand returns afile descriptor that refers toit. The file behaves like a regular file,and so can be modified, truncated, memory-mapped, and so on. However, unlike a regular file, it lives in RAM and has a volatile backing storage. Once all references tothefile are dropped, it is automatically released. Anonymous memory is used for all backing pages ofthefile. Therefore, files created by memfd_create() have the same semantics as other anonymous memory allocations such as those allocated using mmap(2) withthe MAP_ANONYMOUS flag.
The initial size ofthefile is setto0. Following the call, thefile size should be setusing ftruncate(2). (Alternatively, thefile may be populated by calls towrite(2) or similar.)
The name supplied in name is used asa filename and will be displayed asthe target ofthe corresponding symbolic link inthedirectory /proc/self/fd/. The displayed name is always prefixed with memfd: and serves only for debugging purposes. Names donot affect the behavior ofthefile descriptor, andas such multiple files can have the same name withoutany side effects.