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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
// use std::collections::HashMap;
use crateEmEnv;
// pub enum ErrnoCodes {
// EPERM = 1,
// ENOENT = 2,
// ESRCH = 3,
// EINTR = 4,
// EIO = 5,
// ENXIO = 6,
// E2BIG = 7,
// ENOEXEC = 8,
// EBADF = 9,
// ECHILD = 10,
// EAGAIN = 11,
// EWOULDBLOCK = 11,
// ENOMEM = 12,
// EACCES = 13,
// EFAULT = 14,
// ENOTBLK = 15,
// EBUSY = 16,
// EEXIST = 17,
// EXDEV = 18,
// ENODEV = 19,
// ENOTDIR = 20,
// EISDIR = 21,
// EINVAL = 22,
// ENFILE = 23,
// EMFILE = 24,
// ENOTTY = 25,
// ETXTBSY = 26,
// EFBIG = 27,
// ENOSPC = 28,
// ESPIPE = 29,
// EROFS = 30,
// EMLINK = 31,
// EPIPE = 32,
// EDOM = 33,
// ERANGE = 34,
// ENOMSG = 42,
// EIDRM = 43,
// ECHRNG = 44,
// EL2NSYNC = 45,
// EL3HLT = 46,
// EL3RST = 47,
// ELNRNG = 48,
// EUNATCH = 49,
// ENOCSI = 50,
// EL2HLT = 51,
// EDEADLK = 35,
// ENOLCK = 37,
// EBADE = 52,
// EBADR = 53,
// EXFULL = 54,
// ENOANO = 55,
// EBADRQC = 56,
// EBADSLT = 57,
// EDEADLOCK = 35,
// EBFONT = 59,
// ENOSTR = 60,
// ENODATA = 61,
// ETIME = 62,
// ENOSR = 63,
// ENONET = 64,
// ENOPKG = 65,
// EREMOTE = 66,
// ENOLINK = 67,
// EADV = 68,
// ESRMNT = 69,
// ECOMM = 70,
// EPROTO = 71,
// EMULTIHOP = 72,
// EDOTDOT = 73,
// EBADMSG = 74,
// ENOTUNIQ = 76,
// EBADFD = 77,
// EREMCHG = 78,
// ELIBACC = 79,
// ELIBBAD = 80,
// ELIBSCN = 81,
// ELIBMAX = 82,
// ELIBEXEC = 83,
// ENOSYS = 38,
// ENOTEMPTY = 39,
// ENAMETOOLONG = 36,
// ELOOP = 40,
// EOPNOTSUPP = 95,
// EPFNOSUPPORT = 96,
// ECONNRESET = 104,
// ENOBUFS = 105,
// EAFNOSUPPORT = 97,
// EPROTOTYPE = 91,
// ENOTSOCK = 88,
// ENOPROTOOPT = 92,
// ESHUTDOWN = 108,
// ECONNREFUSED = 111,
// EADDRINUSE = 98,
// ECONNABORTED = 103,
// ENETUNREACH = 101,
// ENETDOWN = 100,
// ETIMEDOUT = 110,
// EHOSTDOWN = 112,
// EHOSTUNREACH = 113,
// EINPROGRESS = 115,
// EALREADY = 114,
// EDESTADDRREQ = 89,
// EMSGSIZE = 90,
// EPROTONOSUPPORT = 93,
// ESOCKTNOSUPPORT = 94,
// EADDRNOTAVAIL = 99,
// ENETRESET = 102,
// EISCONN = 106,
// ENOTCONN = 107,
// ETOOMANYREFS = 109,
// EUSERS = 87,
// EDQUOT = 122,
// ESTALE = 116,
// ENOTSUP = 95,
// ENOMEDIUM = 123,
// EILSEQ = 84,
// EOVERFLOW = 75,
// ECANCELED = 125,
// ENOTRECOVERABLE = 131,
// EOWNERDEAD = 130,
// ESTRPIPE = 86,
// }
// pub struct ErrnoMessages<'a> {
// message_map: HashMap<u32, &'a str>
// }
// impl<'a> ErrnoMessages<'a> {
// fn new() -> Self {
// let mut message_map = HashMap::new();
// message_map.insert(0, "Success");
// message_map.insert(1, "Not super-user");
// message_map.insert(2, "No such file or directory");
// message_map.insert(3, "No such process");
// message_map.insert(4, "Interrupted system call");
// message_map.insert(5, "I/O error");
// message_map.insert(6, "No such device or address");
// message_map.insert(7, "Arg list too long");
// message_map.insert(8, "Exec format error");
// message_map.insert(9, "Bad file number");
// message_map.insert(10, "No children");
// message_map.insert(11, "No more processes");
// message_map.insert(12, "Not enough core");
// message_map.insert(13, "Permission denied");
// message_map.insert(14, "Bad address");
// message_map.insert(15, "Block device required");
// message_map.insert(16, "Mount device busy");
// message_map.insert(17, "File exists");
// message_map.insert(18, "Cross-device link");
// message_map.insert(19, "No such device");
// message_map.insert(20, "Not a directory");
// message_map.insert(21, "Is a directory");
// message_map.insert(22, "Invalid argument");
// message_map.insert(23, "Too many open files in system");
// message_map.insert(24, "Too many open files");
// message_map.insert(25, "Not a typewriter");
// message_map.insert(26, "Text file busy");
// message_map.insert(27, "File too large");
// message_map.insert(28, "No space left on device");
// message_map.insert(29, "Illegal seek");
// message_map.insert(30, "Read only file system");
// message_map.insert(31, "Too many links");
// message_map.insert(32, "Broken pipe");
// message_map.insert(33, "Math arg out of domain of func");
// message_map.insert(34, "Math result not representable");
// message_map.insert(35, "File locking deadlock error");
// message_map.insert(36, "File or path name too long");
// message_map.insert(37, "No record locks available");
// message_map.insert(38, "Function not implemented");
// message_map.insert(39, "Directory not empty");
// message_map.insert(40, "Too many symbolic links");
// message_map.insert(42, "No message of desired type");
// message_map.insert(43, "Identifier removed");
// message_map.insert(44, "Channel number out of range");
// message_map.insert(45, "Level 2 not synchronized");
// message_map.insert(46, "Level 3 halted");
// message_map.insert(47, "Level 3 reset");
// message_map.insert(48, "Link number out of range");
// message_map.insert(49, "Protocol driver not attached");
// message_map.insert(50, "No CSI structure available");
// message_map.insert(51, "Level 2 halted");
// message_map.insert(52, "Invalid exchange");
// message_map.insert(53, "Invalid request descriptor");
// message_map.insert(54, "Exchange full");
// message_map.insert(55, "No anode");
// message_map.insert(56, "Invalid request code");
// message_map.insert(57, "Invalid slot");
// message_map.insert(59, "Bad font file fmt");
// message_map.insert(60, "Device not a stream");
// message_map.insert(61, "No data (for no delay io)");
// message_map.insert(62, "Timer expired");
// message_map.insert(63, "Out of streams resources");
// message_map.insert(64, "Machine is not on the network");
// message_map.insert(65, "Package not installed");
// message_map.insert(66, "The object is remote");
// message_map.insert(67, "The link has been severed");
// message_map.insert(68, "Advertise error");
// message_map.insert(69, "Srmount error");
// message_map.insert(70, "Communication error on send");
// message_map.insert(71, "Protocol error");
// message_map.insert(72, "Multihop attempted");
// message_map.insert(73, "Cross mount point (not really error)");
// message_map.insert(74, "Trying to read unreadable message");
// message_map.insert(75, "Value too large for defined data type");
// message_map.insert(76, "Given log. name not unique");
// message_map.insert(77, "f.d. invalid for this operation");
// message_map.insert(78, "Remote address changed");
// message_map.insert(79, "Can access a needed shared lib");
// message_map.insert(80, "Accessing a corrupted shared lib");
// message_map.insert(81, ".lib section in a.out corrupted");
// message_map.insert(82, "Attempting to link in too many libs");
// message_map.insert(83, "Attempting to exec a shared library");
// message_map.insert(84, "Illegal byte sequence");
// message_map.insert(86, "Streams pipe error");
// message_map.insert(87, "Too many users");
// message_map.insert(88, "Socket operation on non-socket");
// message_map.insert(89, "Destination address required");
// message_map.insert(90, "Message too long");
// message_map.insert(91, "Protocol wrong type for socket");
// message_map.insert(92, "Protocol not available");
// message_map.insert(93, "Unknown protocol");
// message_map.insert(94, "Socket type not supported");
// message_map.insert(95, "Not supported");
// message_map.insert(96, "Protocol family not supported");
// message_map.insert(97, "Address family not supported by protocol family");
// message_map.insert(98, "Address already in use");
// message_map.insert(99, "Address not available");
// message_map.insert(100, "Network interface is not configured");
// message_map.insert(101, "Network is unreachable");
// message_map.insert(102, "Connection reset by network");
// message_map.insert(103, "Connection aborted");
// message_map.insert(104, "Connection reset by peer");
// message_map.insert(105, "No buffer space available");
// message_map.insert(106, "Socket is already connected");
// message_map.insert(107, "Socket is not connected");
// message_map.insert(108, "Can't send after socket shutdown");
// message_map.insert(109, "Too many references");
// message_map.insert(110, "Connection timed out");
// message_map.insert(111, "Connection refused");
// message_map.insert(112, "Host is down");
// message_map.insert(113, "Host is unreachable");
// message_map.insert(114, "Socket already connected");
// message_map.insert(115, "Connection already in progress");
// message_map.insert(116, "Stale file handle");
// message_map.insert(122, "Quota exceeded");
// message_map.insert(123, "No medium (in tape drive)");
// message_map.insert(125, "Operation canceled");
// message_map.insert(130, "Previous owner died");
// message_map.insert(131, "State not recoverable");
// ErrnoMessages {
// message_map,
// }
// }
// }