Commit 3b8150c3 authored by Petr Pudlak's avatar Petr Pudlak

Add utility function for creating fields with process IDs

.. using the POSIX type ProcessID.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 7b4bde57
......@@ -37,13 +37,14 @@ module Ganeti.THH.Field
, TagSet
, tagsFields
, fileModeAsIntField
, processIdField
) where
import Control.Monad
import qualified Data.Set as Set
import Language.Haskell.TH
import qualified Text.JSON as JSON
import System.Posix.Types (FileMode)
import System.Posix.Types (FileMode, ProcessID)
import System.Time (ClockTime(..))
import Ganeti.JSON
......@@ -123,3 +124,7 @@ tagsFields = [ defaultField [| Set.empty |] $
-- POSIX file mode representation. The Haskell type of the field is 'FileMode'.
fileModeAsIntField :: String -> Field
fileModeAsIntField = integralField [t| FileMode |]
-- | Creates a new mandatory field that contains a POSIX process ID.
processIdField :: String -> Field
processIdField = integralField [t| ProcessID |]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment