#{poke struct timespec, tv_sec } p s
#{poke struct timespec, tv_nsec} p ns
-foreign import ccall unsafe "time.h clock_gettime"
+foreign import capi unsafe "time.h clock_gettime"
clock_gettime :: ClockID -> Ptr CTimespec -> IO CInt
-foreign import ccall unsafe "time.h clock_getres"
+foreign import capi unsafe "time.h clock_getres"
clock_getres :: ClockID -> Ptr CTimespec -> IO CInt
-- | Get the resolution of the given clock.
{-# LANGUAGE CPP #-}
{-# LANGUAGE Safe #-}
+{-# LANGUAGE CApiFFI #-}
module Data.Time.Clock.Internal.CTimeval where
pokeElemOff (castPtr p) 0 s
pokeElemOff (castPtr p) 1 mus
-foreign import ccall unsafe "time.h gettimeofday" gettimeofday :: Ptr CTimeval -> Ptr () -> IO CInt
+foreign import capi unsafe "sys/time.h gettimeofday" gettimeofday :: Ptr CTimeval -> Ptr () -> IO CInt
-- | Get the current POSIX time from the system clock.
getCTimeval :: IO CTimeval