Linux_ext.Memfdmodule Flags : sig ... endtype t = private Core_unix.File_descr.tval sexp_of_t : t -> Sexplib0.Sexp.tval to_file_descr : t -> Core_unix.File_descr.tval create :
(?flags:Flags.t -> ?initial_size:int -> string -> t) Core.Or_error.tFrom memfd_create():
create creates an anonymous file and returns a file descriptor that refers to it. 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 to the file are dropped, it is automatically released. Anonymous memory is used for all backing pages of the file. Therefore, files created by create have the same semantics as other anonymous memory allocations such as those allocated using mmap with the MAP_ANONYMOUS flag.