memfd-1.0.1.1: 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.

defaultCreateOptions :: Name -> CreateOptions Source #

Default options for create, corresponding to what you get what you use the C library and don't set any flags.

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
Eq Name Source # 
Instance details

Defined in NameType

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Ord Name Source # 
Instance details

Defined in NameType

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Show Name Source # 
Instance details

Defined in NameType

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

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 

Instances

Instances details
Bounded OnExec Source # 
Instance details

Defined in OnExecType

Enum OnExec Source # 
Instance details

Defined in OnExecType

Eq OnExec Source # 
Instance details

Defined in OnExecType

Methods

(==) :: OnExec -> OnExec -> Bool #

(/=) :: OnExec -> OnExec -> Bool #

Ord OnExec Source # 
Instance details

Defined in OnExecType

Show OnExec Source # 
Instance details

Defined in OnExecType

data Sealing Source #

Constructors

AllowSealing

File seals can be applied to the file descriptor

DoNotAllowSealing 

Instances

Instances details
Bounded Sealing Source # 
Instance details

Defined in SealingType

Enum Sealing Source # 
Instance details

Defined in SealingType

Eq Sealing Source # 
Instance details

Defined in SealingType

Methods

(==) :: Sealing -> Sealing -> Bool #

(/=) :: Sealing -> Sealing -> Bool #

Ord Sealing Source # 
Instance details

Defined in SealingType

Show Sealing Source # 
Instance details

Defined in SealingType

data HugeTLBOptions Source #

Not every HugeTLBSize may be available on your platform. If you select an unsupported page size, the system default page size will be used instead. See supportedHugeTLBSizes.

Constructors

DefaultHugeTLB

Use the system default hugetlb page size

HugeTLBSize HugeTLBSize

Prefer the given hugetlb page size

data HugeTLBSize Source #

These sizes may not all be available on your platform. See supportedHugeTLBSizes.

supportedHugeTLBSizes :: [HugeTLBSize] Source #

List of hugetlb sizes that are supported by your platform