The tv_usec field of struct timeval was incorrectly used as C type time_t; the actual C type is suseconds_t. On OS X, time_t is longer than suseconds_t, which caused garbage bits to be copied as reported in trac #4247 and #4970. This patch is part 1 of 4 to fix those tickets.
-- foreign types, and are instances of
-- 'Prelude.Eq', 'Prelude.Ord', 'Prelude.Num', 'Prelude.Read',
-- 'Prelude.Show', 'Prelude.Enum', 'Typeable' and 'Storable'.
-- foreign types, and are instances of
-- 'Prelude.Eq', 'Prelude.Ord', 'Prelude.Num', 'Prelude.Read',
-- 'Prelude.Show', 'Prelude.Enum', 'Typeable' and 'Storable'.
+ , CClock, CTime, CUSeconds, CSUSeconds
-- extracted from CTime, because we don't want this comment in
-- the Haskell 2010 report:
-- extracted from CTime, because we don't want this comment in
-- the Haskell 2010 report:
, CLong(..), CULong(..)
, CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..)
, CLLong(..), CULLong(..)
, CLong(..), CULong(..)
, CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..)
, CLLong(..), CULLong(..)
- , CClock(..), CTime(..)
+ , CClock(..), CTime(..), CUSeconds(..), CSUSeconds(..)
, CFloat(..), CDouble(..), CLDouble(..)
, CIntPtr(..), CUIntPtr(..), CIntMax(..), CUIntMax(..)
#endif
, CFloat(..), CDouble(..), CLDouble(..)
, CIntPtr(..), CUIntPtr(..), CIntMax(..), CUIntMax(..)
#endif
-- | Haskell type representing the C @time_t@ type.
--
ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T)
-- | Haskell type representing the C @time_t@ type.
--
ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T)
+-- | Haskell type representing the C @useconds_t@ type.
+ARITHMETIC_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_USECONDS_T)
+-- | Haskell type representing the C @suseconds_t@ type.
+ARITHMETIC_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_SUSECONDS_T)
-- FIXME: Implement and provide instances for Eq and Storable
-- | Haskell type representing the C @FILE@ type.
-- FIXME: Implement and provide instances for Eq and Storable
-- | Haskell type representing the C @FILE@ type.
, CShort(..), CUShort(..), CInt(..), CUInt(..)
, CLong(..), CULong(..), CLLong(..), CULLong(..)
, CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..)
, CShort(..), CUShort(..), CInt(..), CUInt(..)
, CLong(..), CULong(..), CLLong(..), CULLong(..)
, CPtrdiff(..), CSize(..), CWchar(..), CSigAtomic(..)
- , CClock(..), CTime(..)
+ , CClock(..), CTime(..), CUSeconds(..), CSUSeconds(..)
, CFloat(..), CDouble(..), CLDouble(..)
, CIntPtr(..), CUIntPtr(..),CIntMax(..), CUIntMax(..)
, CFile, CFpos, CJmpBuf
, CFloat(..), CDouble(..), CLDouble(..)
, CIntPtr(..), CUIntPtr(..),CIntMax(..), CUIntMax(..)
, CFile, CFpos, CJmpBuf
FPTOOLS_CHECK_HTYPE(sig_atomic_t, Int32)
FPTOOLS_CHECK_HTYPE(clock_t)
FPTOOLS_CHECK_HTYPE(time_t)
FPTOOLS_CHECK_HTYPE(sig_atomic_t, Int32)
FPTOOLS_CHECK_HTYPE(clock_t)
FPTOOLS_CHECK_HTYPE(time_t)
+FPTOOLS_CHECK_HTYPE(useconds_t)
+FPTOOLS_CHECK_HTYPE(suseconds_t)
FPTOOLS_CHECK_HTYPE(dev_t, Word32)
FPTOOLS_CHECK_HTYPE(ino_t)
FPTOOLS_CHECK_HTYPE(mode_t)
FPTOOLS_CHECK_HTYPE(dev_t, Word32)
FPTOOLS_CHECK_HTYPE(ino_t)
FPTOOLS_CHECK_HTYPE(mode_t)