package core_unix

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Linux_ext.MemfdSource

Sourcemodule Flags : sig ... end
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval to_file_descr : t -> Core_unix.File_descr.t
Sourceval 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.