[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / lib / haskell-1.3 / LibPosixErr.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
3 %
4 \section[LibPosixErr]{Haskell 1.3 POSIX Error Codes}
5
6 \begin{code}
7 module LibPosixErr
8 where
9
10 import PreludeGlaST
11
12 type ErrorCode = Int
13
14 getErrorCode :: IO ErrorCode
15 getErrorCode =
16     _casm_ ``%r = errno;''                          `thenPrimIO` \ errno ->
17     return errno
18
19 setErrorCode :: ErrorCode -> IO ()
20 setErrorCode errno =
21     _casm_ ``errno = %0;'' errno                    `thenPrimIO` \ () ->
22     return ()
23
24 noError :: ErrorCode
25 noError = 0
26
27 argumentListTooLong, e2BIG :: ErrorCode
28 argumentListTooLong = ``E2BIG''
29 e2BIG = ``E2BIG''
30
31 badChannel, eBADF :: ErrorCode
32 badChannel = ``EBADF''
33 eBADF = ``EBADF''
34
35 brokenPipe, ePIPE :: ErrorCode
36 brokenPipe = ``EPIPE''
37 ePIPE = ``EPIPE''
38
39 directoryNotEmpty, eNOTEMPTY :: ErrorCode
40 directoryNotEmpty = ``ENOTEMPTY''
41 eNOTEMPTY = ``ENOTEMPTY''
42
43 execFormatError, eNOEXEC :: ErrorCode
44 execFormatError = ``ENOEXEC''
45 eNOEXEC = ``ENOEXEC''
46
47 fileAlreadyExists, eEXIST :: ErrorCode
48 fileAlreadyExists = ``EEXIST''
49 eEXIST = ``EEXIST''
50
51 fileTooLarge, eFBIG :: ErrorCode
52 fileTooLarge = ``EFBIG''
53 eFBIG = ``EFBIG''
54
55 filenameTooLong, eNAMETOOLONG :: ErrorCode
56 filenameTooLong = ``ENAMETOOLONG''
57 eNAMETOOLONG = ``ENAMETOOLONG''
58
59 improperLink, eXDEV :: ErrorCode
60 improperLink = ``EXDEV''
61 eXDEV = ``EXDEV''
62
63 inappropriateIOControlOperation, eNOTTY :: ErrorCode
64 inappropriateIOControlOperation = ``ENOTTY''
65 eNOTTY = ``ENOTTY''
66
67 inputOutputError, eIO :: ErrorCode
68 inputOutputError = ``EIO''
69 eIO = ``EIO''
70
71 interruptedOperation, eINTR :: ErrorCode
72 interruptedOperation = ``EINTR''
73 eINTR = ``EINTR''
74
75 invalidArgument, eINVAL :: ErrorCode
76 invalidArgument = ``EINVAL''
77 eINVAL = ``EINVAL''
78
79 invalidSeek, eSPIPE :: ErrorCode
80 invalidSeek = ``ESPIPE''
81 eSPIPE = ``ESPIPE''
82
83 isADirectory, eISDIR :: ErrorCode
84 isADirectory = ``EISDIR''
85 eISDIR = ``EISDIR''
86
87 noChildProcess, eCHILD :: ErrorCode
88 noChildProcess = ``ECHILD''
89 eCHILD = ``ECHILD''
90
91 noLocksAvailable, eNOLCK :: ErrorCode
92 noLocksAvailable = ``ENOLCK''
93 eNOLCK = ``ENOLCK''
94
95 noSpaceLeftOnDevice, eNOSPC :: ErrorCode
96 noSpaceLeftOnDevice = ``ENOSPC''
97 eNOSPC = ``ENOSPC''
98
99 noSuchOperationOnDevice, eNODEV :: ErrorCode
100 noSuchOperationOnDevice = ``ENODEV''
101 eNODEV = ``ENODEV''
102
103 noSuchDeviceOrAddress, eNXIO :: ErrorCode
104 noSuchDeviceOrAddress = ``ENXIO''
105 eNXIO = ``ENXIO''
106
107 noSuchFileOrDirectory, eNOENT :: ErrorCode
108 noSuchFileOrDirectory = ``ENOENT''
109 eNOENT = ``ENOENT''
110
111 noSuchProcess, eSRCH :: ErrorCode
112 noSuchProcess = ``ESRCH''
113 eSRCH = ``ESRCH''
114
115 notADirectory, eNOTDIR :: ErrorCode
116 notADirectory = ``ENOTDIR''
117 eNOTDIR = ``ENOTDIR''
118
119 notEnoughMemory, eNOMEM :: ErrorCode
120 notEnoughMemory = ``ENOMEM''
121 eNOMEM = ``ENOMEM''
122
123 operationNotImplemented, eNOSYS :: ErrorCode
124 operationNotImplemented = ``ENOSYS''
125 eNOSYS = ``ENOSYS''
126
127 operationNotPermitted, ePERM :: ErrorCode
128 operationNotPermitted = ``EPERM''
129 ePERM = ``EPERM''
130
131 permissionDenied, eACCES :: ErrorCode
132 permissionDenied = ``EACCES''
133 eACCES = ``EACCES''
134
135 readOnlyFileSystem, eROFS :: ErrorCode
136 readOnlyFileSystem = ``EROFS''
137 eROFS = ``EROFS''
138
139 resourceBusy, eBUSY :: ErrorCode
140 resourceBusy = ``EBUSY''
141 eBUSY = ``EBUSY''
142
143 resourceDeadlockAvoided, eDEADLK :: ErrorCode
144 resourceDeadlockAvoided = ``EDEADLK''
145 eDEADLK = ``EDEADLK''
146
147 resourceTemporarilyUnavailable, eAGAIN :: ErrorCode
148 resourceTemporarilyUnavailable = ``EAGAIN''
149 eAGAIN = ``EAGAIN''
150
151 tooManyLinks, eMLINK :: ErrorCode
152 tooManyLinks = ``EMLINK''
153 eMLINK = ``EMLINK''
154
155 tooManyOpenFiles, eMFILE :: ErrorCode
156 tooManyOpenFiles = ``EMFILE''
157 eMFILE = ``EMFILE''
158
159 tooManyOpenFilesInSystem, eNFILE :: ErrorCode
160 tooManyOpenFilesInSystem = ``ENFILE''
161 eNFILE = ``ENFILE''
162
163 \end{code}
164