1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
4 -- Module : System.Posix.Types
5 -- Copyright : (c) The University of Glasgow 2002
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : provisional
10 -- Portability : non-portable (requires POSIX)
12 -- POSIX data types: Haskell equivalents of the types defined by the
13 -- @\<sys\/types.h>@ C header on a POSIX system.
15 -----------------------------------------------------------------------------
19 module System.Posix.Types (
22 CDev, CIno, CMode, COff, CPid, CSsize,
24 #ifndef mingw32_TARGET_OS
25 CGid, CNlink, CUid, CCc, CSpeed,
31 #ifndef mingw32_TARGET_OS
53 #ifdef __GLASGOW_HASKELL__
68 NUMERIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
69 INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
70 INTEGRAL_TYPE(CMode,tyConCMode,"CMode",HTYPE_MODE_T)
71 INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
72 INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
74 #ifdef mingw32_TARGET_OS
75 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SIZE_T)
77 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
80 #ifndef mingw32_TARGET_OS
81 INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)
82 INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
83 INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
84 NUMERIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
85 NUMERIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
86 INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
87 INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)
90 -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
91 -- suseconds_t, timer_t, useconds_t
93 -- Make an Fd type rather than using CInt everywhere
94 INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
96 -- nicer names, and backwards compatibility with POSIX library:
97 #ifndef mingw32_TARGET_OS
98 type LinkCount = CNlink
103 type ByteCount = CSize
104 type ClockTick = CClock
105 type EpochTime = CTime
108 type FileMode = CMode
109 type ProcessID = CPid
110 type FileOffset = COff
111 type ProcessGroupID = CPid