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 -----------------------------------------------------------------------------
17 #include "HsBaseConfig.h"
19 module System.Posix.Types (
22 #if defined(HTYPE_DEV_T)
25 #if defined(HTYPE_INO_T)
28 #if defined(HTYPE_MODE_T)
31 #if defined(HTYPE_OFF_T)
34 #if defined(HTYPE_PID_T)
37 #if defined(HTYPE_SIZE_T) || defined(HTYPE_SSIZE_T)
41 #if defined(HTYPE_GID_T)
44 #if defined(HTYPE_NLINK_T)
47 #if defined(HTYPE_UID_T)
50 #if defined(HTYPE_CC_T)
53 #if defined(HTYPE_SPEED_T)
56 #if defined(HTYPE_TCFLAG_T)
59 #if defined(HTYPE_RLIM_T)
65 #if defined(HTYPE_NLINK_T)
68 #if defined(HTYPE_UID_T)
71 #if defined(HTYPE_GID_T)
92 #ifdef __GLASGOW_HASKELL__
106 #if defined(HTYPE_DEV_T)
107 ARITHMETIC_TYPE(CDev,tyConCDev,"CDev",HTYPE_DEV_T)
109 #if defined(HTYPE_INO_T)
110 INTEGRAL_TYPE(CIno,tyConCIno,"CIno",HTYPE_INO_T)
112 #if defined(HTYPE_MODE_T)
113 INTEGRAL_TYPE(CMode,tyConCMode,"CMode",HTYPE_MODE_T)
115 #if defined(HTYPE_OFF_T)
116 INTEGRAL_TYPE(COff,tyConCOff,"COff",HTYPE_OFF_T)
118 #if defined(HTYPE_PID_T)
119 INTEGRAL_TYPE(CPid,tyConCPid,"CPid",HTYPE_PID_T)
122 #if defined(HTYPE_SIZE_T)
123 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SIZE_T)
126 #if defined(HTYPE_SSIZE_T) && !defined(HTYPE_SIZE_T)
127 INTEGRAL_TYPE(CSsize,tyConCSsize,"CSsize",HTYPE_SSIZE_T)
130 #if defined(HTYPE_GID_T)
131 INTEGRAL_TYPE(CGid,tyConCGid,"CGid",HTYPE_GID_T)
133 #if defined(HTYPE_NLINK_T)
134 INTEGRAL_TYPE(CNlink,tyConCNlink,"CNlink",HTYPE_NLINK_T)
137 #if defined(HTYPE_UID_T)
138 INTEGRAL_TYPE(CUid,tyConCUid,"CUid",HTYPE_UID_T)
140 #if defined(HTYPE_CC_T)
141 ARITHMETIC_TYPE(CCc,tyConCCc,"CCc",HTYPE_CC_T)
143 #if defined(HTYPE_SPEED_T)
144 ARITHMETIC_TYPE(CSpeed,tyConCSpeed,"CSpeed",HTYPE_SPEED_T)
146 #if defined(HTYPE_TCFLAG_T)
147 INTEGRAL_TYPE(CTcflag,tyConCTcflag,"CTcflag",HTYPE_TCFLAG_T)
149 #if defined(HTYPE_RLIM_T)
150 INTEGRAL_TYPE(CRLim,tyConCRlim,"CRLim",HTYPE_RLIM_T)
153 -- ToDo: blksize_t, clockid_t, blkcnt_t, fsblkcnt_t, fsfilcnt_t, id_t, key_t
154 -- suseconds_t, timer_t, useconds_t
156 -- Make an Fd type rather than using CInt everywhere
157 INTEGRAL_TYPE(Fd,tyConFd,"Fd",CInt)
159 -- nicer names, and backwards compatibility with POSIX library:
160 #if defined(HTYPE_NLINK_T)
161 type LinkCount = CNlink
163 #if defined(HTYPE_UID_T)
166 #if defined(HTYPE_GID_T)
170 type ByteCount = CSize
171 type ClockTick = CClock
172 type EpochTime = CTime
175 type FileMode = CMode
176 type ProcessID = CPid
177 type FileOffset = COff
178 type ProcessGroupID = CPid