memfd-1.0.0.0: Open temporary anonymous Linux file handles
Safe HaskellNone
LanguageHaskell2010

Memfd

Description

"memfd" (memory file descriptor) lets us open pseudo-"files" that are not actually stored in the "real" file system. This feature is only available on Linux.

This module is a small FFI wrapper around the memfd_create C system call. Some documentation in this package is copied/paraphrased from the Linux Programmer's Manual. Run "man 2 memfd_create" to see the full documentation.

Synopsis

Documentation

create :: CreateOptions -> IO Fd Source #

Creates an anonymous file

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.

newtype Name Source #

The name of an anonymous file

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

Constructors

NameString 

Fields

Instances

Instances details
IsString Name Source # 
Instance details

Defined in NameType

Methods

fromString :: String -> Name #

data OnExec Source #

Constructors

CloseOnExec

The file descriptor will automatically be closed during a successful execve

RemainOpenOnExec 

data Sealing Source #

Constructors

AllowSealing

File seals can be applied to the file descriptor

DoNotAllowSealing