package core_unix

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Flags : sig ... end
type t = private Core_unix.File_descr.t
val sexp_of_t : t -> Sexplib0.Sexp.t
val to_file_descr : t -> Core_unix.File_descr.t
val create : (?flags:Flags.t -> ?initial_size:int -> string -> t) Core.Or_error.t

From 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.

OCaml

Innovation. Community. Security.