{-# LINE 1 "Foundation/System/Bindings/Time.hsc" #-}
-- |
-- Module      :  Foundation.System.Bindings.Time
-- Maintainer  :  Haskell foundation
--

module Foundation.System.Bindings.Time where

import Basement.Compat.Base
import Basement.Compat.C.Types
import Basement.Types.OffsetSize





type CClockId = CInt
data CTimeSpec
data CTimeVal
data CTimeZone

size_CTimeSpec :: CSize
size_CTimeSpec = 16
{-# LINE 23 "Foundation/System/Bindings/Time.hsc" #-}

ofs_CTimeSpec_Seconds :: Offset Word8
ofs_CTimeSpec_Seconds = Offset ((0))
{-# LINE 26 "Foundation/System/Bindings/Time.hsc" #-}

ofs_CTimeSpec_NanoSeconds :: Offset Word8
ofs_CTimeSpec_NanoSeconds = Offset ((8))
{-# LINE 29 "Foundation/System/Bindings/Time.hsc" #-}

size_CTimeVal :: CSize
size_CTimeVal = 16
{-# LINE 32 "Foundation/System/Bindings/Time.hsc" #-}

size_CTimeZone :: CSize
size_CTimeZone = 8
{-# LINE 35 "Foundation/System/Bindings/Time.hsc" #-}

size_CTimeT :: CSize
size_CTimeT = 8
{-# LINE 38 "Foundation/System/Bindings/Time.hsc" #-}

------------------------------------------------------------------------

{-# LINE 48 "Foundation/System/Bindings/Time.hsc" #-}


sysTime_CLOCK_REALTIME :: CClockId

{-# LINE 54 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_REALTIME = (0)
{-# LINE 55 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 56 "Foundation/System/Bindings/Time.hsc" #-}

sysTime_CLOCK_MONOTONIC :: CClockId

{-# LINE 61 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_MONOTONIC = (1)
{-# LINE 62 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 63 "Foundation/System/Bindings/Time.hsc" #-}

sysTime_CLOCK_PROCESS_CPUTIME_ID :: CClockId

{-# LINE 68 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_PROCESS_CPUTIME_ID = (2)
{-# LINE 69 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 70 "Foundation/System/Bindings/Time.hsc" #-}

sysTime_CLOCK_THREAD_CPUTIME_ID :: CClockId

{-# LINE 75 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_THREAD_CPUTIME_ID = (3)
{-# LINE 76 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 77 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 79 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_MONOTONIC_RAW :: CClockId
sysTime_CLOCK_MONOTONIC_RAW = (4)
{-# LINE 81 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 82 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 84 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_REALTIME_COARSE :: CClockId
sysTime_CLOCK_REALTIME_COARSE = (5)
{-# LINE 86 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 87 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 92 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 94 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_BOOTTIME :: CClockId
sysTime_CLOCK_BOOTTIME = (7)
{-# LINE 96 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 97 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 99 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_REALTIME_ALARM :: CClockId
sysTime_CLOCK_REALTIME_ALARM = (8)
{-# LINE 101 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 102 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 104 "Foundation/System/Bindings/Time.hsc" #-}
sysTime_CLOCK_BOOTTIME_ALARM :: CClockId
sysTime_CLOCK_BOOTTIME_ALARM = (9)
{-# LINE 106 "Foundation/System/Bindings/Time.hsc" #-}

{-# LINE 107 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 112 "Foundation/System/Bindings/Time.hsc" #-}


{-# LINE 119 "Foundation/System/Bindings/Time.hsc" #-}
foreign import ccall unsafe "clock_getres"
    sysTimeClockGetRes :: CClockId -> Ptr CTimeSpec -> IO CInt
foreign import ccall unsafe "clock_gettime"
    sysTimeClockGetTime :: CClockId -> Ptr CTimeSpec -> IO CInt

{-# LINE 124 "Foundation/System/Bindings/Time.hsc" #-}

foreign import ccall unsafe "gettimeofday"
    sysTimeGetTimeOfDay :: Ptr CTimeVal -> Ptr CTimeZone -> IO CInt