From: Marios Titas Date: Sun, 2 Oct 2022 20:12:43 +0000 (+0300) Subject: [PATCH] Use capi for syscalls that break under musl's handling of 64-bit time_t X-Git-Tag: archive/raspbian/9.6.6-2+rpi1~2^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=48878289996b395637bcfc54346d1b22d774d538;p=ghc.git [PATCH] Use capi for syscalls that break under musl's handling of 64-bit time_t Gbp-Pq: Name time_t-time --- diff --git a/libraries/time/lib/Data/Time/Clock/Internal/CTimespec.hsc b/libraries/time/lib/Data/Time/Clock/Internal/CTimespec.hsc index 9b162e6c..ee0ad1a5 100644 --- a/libraries/time/lib/Data/Time/Clock/Internal/CTimespec.hsc +++ b/libraries/time/lib/Data/Time/Clock/Internal/CTimespec.hsc @@ -27,9 +27,9 @@ instance Storable CTimespec where #{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. diff --git a/libraries/time/lib/Data/Time/Clock/Internal/CTimeval.hs b/libraries/time/lib/Data/Time/Clock/Internal/CTimeval.hs index f9ba6596..beb39501 100644 --- a/libraries/time/lib/Data/Time/Clock/Internal/CTimeval.hs +++ b/libraries/time/lib/Data/Time/Clock/Internal/CTimeval.hs @@ -1,5 +1,6 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE Safe #-} +{-# LANGUAGE CApiFFI #-} module Data.Time.Clock.Internal.CTimeval where @@ -23,7 +24,7 @@ instance Storable 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