-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Open temporary anonymous Linux file handles -- -- "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. @package memfd @version 1.0.0.0 -- | "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. module Memfd -- | 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. create :: CreateOptions -> IO Fd data CreateOptions CreateOptions :: Name -> OnExec -> Sealing -> FileSystem -> CreateOptions [name] :: CreateOptions -> Name [onExec] :: CreateOptions -> OnExec [sealing] :: CreateOptions -> Sealing [fileSystem] :: CreateOptions -> FileSystem -- | 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. newtype Name NameString :: String -> Name [nameString] :: Name -> String data OnExec -- | The file descriptor will automatically be closed during a successful -- execve CloseOnExec :: OnExec RemainOpenOnExec :: OnExec data Sealing -- | File seals can be applied to the file descriptor AllowSealing :: Sealing DoNotAllowSealing :: Sealing data FileSystem TemporaryFileSystem :: FileSystem HugeTLBFileSystem :: HugeTLBOptions -> FileSystem data HugeTLBOptions DefaultHugeTLB :: HugeTLBOptions HugeTLBSize :: HugeTLBSize -> HugeTLBOptions data HugeTLBSize HugeTLB_64KB :: HugeTLBSize HugeTLB_512KB :: HugeTLBSize HugeTLB_1MB :: HugeTLBSize HugeTLB_2MB :: HugeTLBSize HugeTLB_8MB :: HugeTLBSize HugeTLB_16MB :: HugeTLBSize HugeTLB_32MB :: HugeTLBSize HugeTLB_256MB :: HugeTLBSize HugeTLB_512MB :: HugeTLBSize HugeTLB_1GB :: HugeTLBSize HugeTLB_2GB :: HugeTLBSize HugeTLB_16GB :: HugeTLBSize