module Memfd.DefaultCreateOptions where

import Memfd.CreateOptionsType (CreateOptions(..))
import Memfd.FileSystemType (FileSystem (TemporaryFileSystem))
import Memfd.NameType (Name)
import Memfd.OnExecType (OnExec (RemainOpenOnExec))
import Memfd.SealingType (Sealing (DoNotAllowSealing))

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

* 'onExec' = 'RemainOpenOnExec'
* 'sealing' = 'DoNotAllowSealing'
* 'fileSystem' = 'TemporaryFileSystem'
-}
defaultCreateOptions :: Name -> CreateOptions
defaultCreateOptions :: Name -> CreateOptions
defaultCreateOptions Name
x =
  CreateOptions
    { name :: Name
name = Name
x
    , onExec :: OnExec
onExec = OnExec
RemainOpenOnExec
    , sealing :: Sealing
sealing = Sealing
DoNotAllowSealing
    , fileSystem :: FileSystem
fileSystem = FileSystem
TemporaryFileSystem
    }