blob: a1d8f2fd34d3efb60a4db8e2392fc211bb5bfda5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{-# OPTIONS -fffi #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Time
-- Copyright : (c) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Portability : non-portable (requires POSIX)
--
-- POSIX Time support
--
-----------------------------------------------------------------------------
module System.Posix.Time (
epochTime,
-- ToDo: lots more from sys/time.h
-- how much already supported by System.Time?
) where
#include "HsUnix.h"
import System.Posix.Types
import Foreign
import Foreign.C
-- -----------------------------------------------------------------------------
-- epochTime
epochTime :: IO EpochTime
epochTime = throwErrnoIfMinus1 "epochTime" (c_time nullPtr)
foreign import ccall unsafe "time"
c_time :: Ptr CTime -> IO CTime
|