blob: 24ea25d08820e78a4f7ef50206bff9b67954d8b8 (
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
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
|
%
% (c) The GRASP/AQUA Project, Glasgow University, 1994
%
\subsection[errno.lc]{GHC Error Number Conversion}
\begin{code}
#include "rtsdefs.h"
#include "stgio.h"
int ghc_errno = 0;
int ghc_errtype = 0;
char *ghc_errstr = NULL;
/* Collect all of the grotty #ifdef's in one place. */
void cvtErrno(STG_NO_ARGS)
{
switch(errno) {
#ifdef E2BIG
case E2BIG:
ghc_errno = GHC_E2BIG;
break;
#endif
#ifdef EACCES
case EACCES:
ghc_errno = GHC_EACCES;
break;
#endif
#ifdef EADDRINUSE
case EADDRINUSE:
ghc_errno = GHC_EADDRINUSE;
break;
#endif
#ifdef EADDRNOTAVAIL
case EADDRNOTAVAIL:
ghc_errno = GHC_EADDRNOTAVAIL;
break;
#endif
#ifdef EADV
case EADV:
ghc_errno = GHC_EADV;
break;
#endif
#ifdef EAFNOSUPPORT
case EAFNOSUPPORT:
ghc_errno = GHC_EAFNOSUPPORT;
break;
#endif
#ifdef EAGAIN
case EAGAIN:
ghc_errno = GHC_EAGAIN;
break;
#endif
#ifdef EALREADY
case EALREADY:
ghc_errno = GHC_EALREADY;
break;
#endif
#ifdef EBADF
case EBADF:
ghc_errno = GHC_EBADF;
break;
#endif
#ifdef EBADMSG
case EBADMSG:
ghc_errno = GHC_EBADMSG;
break;
#endif
#ifdef EBADRPC
case EBADRPC:
ghc_errno = GHC_EBADRPC;
break;
#endif
#ifdef EBUSY
case EBUSY:
ghc_errno = GHC_EBUSY;
break;
#endif
#ifdef ECHILD
case ECHILD:
ghc_errno = GHC_ECHILD;
break;
#endif
#ifdef ECOMM
case ECOMM:
ghc_errno = GHC_ECOMM;
break;
#endif
#ifdef ECONNABORTED
case ECONNABORTED:
ghc_errno = GHC_ECONNABORTED;
break;
#endif
#ifdef ECONNREFUSED
case ECONNREFUSED:
ghc_errno = GHC_ECONNREFUSED;
break;
#endif
#ifdef ECONNRESET
case ECONNRESET:
ghc_errno = GHC_ECONNRESET;
break;
#endif
#ifdef EDEADLK
case EDEADLK:
ghc_errno = GHC_EDEADLK;
break;
#endif
#ifdef EDESTADDRREQ
case EDESTADDRREQ:
ghc_errno = GHC_EDESTADDRREQ;
break;
#endif
#ifdef EDIRTY
case EDIRTY:
ghc_errno = GHC_EDIRTY;
break;
#endif
#ifdef EDOM
case EDOM:
ghc_errno = GHC_EDOM;
break;
#endif
#ifdef EDQUOT
case EDQUOT:
ghc_errno = GHC_EDQUOT;
break;
#endif
#ifdef EEXIST
case EEXIST:
ghc_errno = GHC_EEXIST;
break;
#endif
#ifdef EFAULT
case EFAULT:
ghc_errno = GHC_EFAULT;
break;
#endif
#ifdef EFBIG
case EFBIG:
ghc_errno = GHC_EFBIG;
break;
#endif
#ifdef EFTYPE
case EFTYPE:
ghc_errno = GHC_EFTYPE;
break;
#endif
#ifdef EHOSTDOWN
case EHOSTDOWN:
ghc_errno = GHC_EHOSTDOWN;
break;
#endif
#ifdef EHOSTUNREACH
case EHOSTUNREACH:
ghc_errno = GHC_EHOSTUNREACH;
break;
#endif
#ifdef EIDRM
case EIDRM:
ghc_errno = GHC_EIDRM;
break;
#endif
#ifdef EILSEQ
case EILSEQ:
ghc_errno = GHC_EILSEQ;
break;
#endif
#ifdef EINPROGRESS
case EINPROGRESS:
ghc_errno = GHC_EINPROGRESS;
break;
#endif
#ifdef EINTR
case EINTR:
ghc_errno = GHC_EINTR;
break;
#endif
#ifdef EINVAL
case EINVAL:
ghc_errno = GHC_EINVAL;
break;
#endif
#ifdef EIO
case EIO:
ghc_errno = GHC_EIO;
break;
#endif
#ifdef EISCONN
case EISCONN:
ghc_errno = GHC_EISCONN;
break;
#endif
#ifdef EISDIR
case EISDIR:
ghc_errno = GHC_EISDIR;
break;
#endif
#ifdef ELOOP
case ELOOP:
ghc_errno = GHC_ELOOP;
break;
#endif
#ifdef EMFILE
case EMFILE:
ghc_errno = GHC_EMFILE;
break;
#endif
#ifdef EMLINK
case EMLINK:
ghc_errno = GHC_EMLINK;
break;
#endif
#ifdef EMSGSIZE
case EMSGSIZE:
ghc_errno = GHC_EMSGSIZE;
break;
#endif
#ifdef EMULTIHOP
case EMULTIHOP:
ghc_errno = GHC_EMULTIHOP;
break;
#endif
#ifdef ENAMETOOLONG
case ENAMETOOLONG:
ghc_errno = GHC_ENAMETOOLONG;
break;
#endif
#ifdef ENETDOWN
case ENETDOWN:
ghc_errno = GHC_ENETDOWN;
break;
#endif
#ifdef ENETRESET
case ENETRESET:
ghc_errno = GHC_ENETRESET;
break;
#endif
#ifdef ENETUNREACH
case ENETUNREACH:
ghc_errno = GHC_ENETUNREACH;
break;
#endif
#ifdef ENFILE
case ENFILE:
ghc_errno = GHC_ENFILE;
break;
#endif
#ifdef ENOBUFS
case ENOBUFS:
ghc_errno = GHC_ENOBUFS;
break;
#endif
#ifdef ENODATA
case ENODATA:
ghc_errno = GHC_ENODATA;
break;
#endif
#ifdef ENODEV
case ENODEV:
ghc_errno = GHC_ENODEV;
break;
#endif
#ifdef ENOENT
case ENOENT:
ghc_errno = GHC_ENOENT;
break;
#endif
#ifdef ENOEXEC
case ENOEXEC:
ghc_errno = GHC_ENOEXEC;
break;
#endif
#ifdef ENOLCK
case ENOLCK:
ghc_errno = GHC_ENOLCK;
break;
#endif
#ifdef ENOLINK
case ENOLINK:
ghc_errno = GHC_ENOLINK;
break;
#endif
#ifdef ENOMEM
case ENOMEM:
ghc_errno = GHC_ENOMEM;
break;
#endif
#ifdef ENOMSG
case ENOMSG:
ghc_errno = GHC_ENOMSG;
break;
#endif
#ifdef ENONET
case ENONET:
ghc_errno = GHC_ENONET;
break;
#endif
#ifdef ENOPROTOOPT
case ENOPROTOOPT:
ghc_errno = GHC_ENOPROTOOPT;
break;
#endif
#ifdef ENOSPC
case ENOSPC:
ghc_errno = GHC_ENOSPC;
break;
#endif
#ifdef ENOSR
case ENOSR:
ghc_errno = GHC_ENOSR;
break;
#endif
#ifdef ENOSTR
case ENOSTR:
ghc_errno = GHC_ENOSTR;
break;
#endif
#ifdef ENOSYS
case ENOSYS:
ghc_errno = GHC_ENOSYS;
break;
#endif
#ifdef ENOTBLK
case ENOTBLK:
ghc_errno = GHC_ENOTBLK;
break;
#endif
#ifdef ENOTCONN
case ENOTCONN:
ghc_errno = GHC_ENOTCONN;
break;
#endif
#ifdef ENOTDIR
case ENOTDIR:
ghc_errno = GHC_ENOTDIR;
break;
#endif
#ifdef ENOTEMPTY
case ENOTEMPTY:
ghc_errno = GHC_ENOTEMPTY;
break;
#endif
#ifdef ENOTSOCK
case ENOTSOCK:
ghc_errno = GHC_ENOTSOCK;
break;
#endif
#ifdef ENOTTY
case ENOTTY:
ghc_errno = GHC_ENOTTY;
break;
#endif
#ifdef ENXIO
case ENXIO:
ghc_errno = GHC_ENXIO;
break;
#endif
#ifdef EOPNOTSUPP
case EOPNOTSUPP:
ghc_errno = GHC_EOPNOTSUPP;
break;
#endif
#ifdef EPERM
case EPERM:
ghc_errno = GHC_EPERM;
break;
#endif
#ifdef EPFNOSUPPORT
case EPFNOSUPPORT:
ghc_errno = GHC_EPFNOSUPPORT;
break;
#endif
#ifdef EPIPE
case EPIPE:
ghc_errno = GHC_EPIPE;
break;
#endif
#ifdef EPROCLIM
case EPROCLIM:
ghc_errno = GHC_EPROCLIM;
break;
#endif
#ifdef EPROCUNAVAIL
case EPROCUNAVAIL:
ghc_errno = GHC_EPROCUNAVAIL;
break;
#endif
#ifdef EPROGMISMATCH
case EPROGMISMATCH:
ghc_errno = GHC_EPROGMISMATCH;
break;
#endif
#ifdef EPROGUNAVAIL
case EPROGUNAVAIL:
ghc_errno = GHC_EPROGUNAVAIL;
break;
#endif
#ifdef EPROTO
case EPROTO:
ghc_errno = GHC_EPROTO;
break;
#endif
#ifdef EPROTONOSUPPORT
case EPROTONOSUPPORT:
ghc_errno = GHC_EPROTONOSUPPORT;
break;
#endif
#ifdef EPROTOTYPE
case EPROTOTYPE:
ghc_errno = GHC_EPROTOTYPE;
break;
#endif
#ifdef ERANGE
case ERANGE:
ghc_errno = GHC_ERANGE;
break;
#endif
#ifdef EREMCHG
case EREMCHG:
ghc_errno = GHC_EREMCHG;
break;
#endif
#ifdef EREMOTE
case EREMOTE:
ghc_errno = GHC_EREMOTE;
break;
#endif
#ifdef EROFS
case EROFS:
ghc_errno = GHC_EROFS;
break;
#endif
#ifdef ERPCMISMATCH
case ERPCMISMATCH:
ghc_errno = GHC_ERPCMISMATCH;
break;
#endif
#ifdef ERREMOTE
case ERREMOTE:
ghc_errno = GHC_ERREMOTE;
break;
#endif
#ifdef ESHUTDOWN
case ESHUTDOWN:
ghc_errno = GHC_ESHUTDOWN;
break;
#endif
#ifdef ESOCKTNOSUPPORT
case ESOCKTNOSUPPORT:
ghc_errno = GHC_ESOCKTNOSUPPORT;
break;
#endif
#ifdef ESPIPE
case ESPIPE:
ghc_errno = GHC_ESPIPE;
break;
#endif
#ifdef ESRCH
case ESRCH:
ghc_errno = GHC_ESRCH;
break;
#endif
#ifdef ESRMNT
case ESRMNT:
ghc_errno = GHC_ESRMNT;
break;
#endif
#ifdef ESTALE
case ESTALE:
ghc_errno = GHC_ESTALE;
break;
#endif
#ifdef ETIME
case ETIME:
ghc_errno = GHC_ETIME;
break;
#endif
#ifdef ETIMEDOUT
case ETIMEDOUT:
ghc_errno = GHC_ETIMEDOUT;
break;
#endif
#ifdef ETOOMANYREFS
case ETOOMANYREFS:
ghc_errno = GHC_ETOOMANYREFS;
break;
#endif
#ifdef ETXTBSY
case ETXTBSY:
ghc_errno = GHC_ETXTBSY;
break;
#endif
#ifdef EUSERS
case EUSERS:
ghc_errno = GHC_EUSERS;
break;
#endif
#if 0
#ifdef EWOULDBLOCK
case EWOULDBLOCK:
ghc_errno = GHC_EWOULDBLOCK;
break;
#endif
#endif
#ifdef EXDEV
case EXDEV:
ghc_errno = GHC_EXDEV;
break;
#endif
default:
ghc_errno = errno;
break;
}
}
void
stdErrno(STG_NO_ARGS)
{
switch(ghc_errno) {
default:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "unexpected error";
break;
case 0:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "no error";
case GHC_E2BIG:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "argument list too long";
break;
case GHC_EACCES:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "inadequate access permission";
break;
case GHC_EADDRINUSE:
ghc_errtype = ERR_RESOURCEBUSY;
ghc_errstr = "address already in use";
break;
case GHC_EADDRNOTAVAIL:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "address not available";
break;
case GHC_EADV:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "RFS advertise error";
break;
case GHC_EAFNOSUPPORT:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "address family not supported by protocol family";
break;
case GHC_EAGAIN:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "insufficient resources";
break;
case GHC_EALREADY:
ghc_errtype = ERR_ALREADYEXISTS;
ghc_errstr = "operation already in progress";
break;
case GHC_EBADF:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "internal error (EBADF)";
break;
case GHC_EBADMSG:
ghc_errtype = ERR_INAPPROPRIATETYPE;
ghc_errstr = "next message has wrong type";
break;
case GHC_EBADRPC:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "invalid RPC request or response";
break;
case GHC_EBUSY:
ghc_errtype = ERR_RESOURCEBUSY;
ghc_errstr = "device busy";
break;
case GHC_ECHILD:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no child processes";
break;
case GHC_ECOMM:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "no virtual circuit could be found";
break;
case GHC_ECONNABORTED:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "aborted connection";
break;
case GHC_ECONNREFUSED:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no listener on remote host";
break;
case GHC_ECONNRESET:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "connection reset by peer";
break;
case GHC_EDEADLK:
ghc_errtype = ERR_RESOURCEBUSY;
ghc_errstr = "resource deadlock avoided";
break;
case GHC_EDESTADDRREQ:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "destination address required";
break;
case GHC_EDIRTY:
ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
ghc_errstr = "file system dirty";
break;
case GHC_EDOM:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "argument too large";
break;
case GHC_EDQUOT:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "quota exceeded";
break;
case GHC_EEXIST:
ghc_errtype = ERR_ALREADYEXISTS;
ghc_errstr = "file already exists";
break;
case GHC_EFAULT:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "internal error (EFAULT)";
break;
case GHC_EFBIG:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "file too large";
break;
case GHC_EFTYPE:
ghc_errtype = ERR_INAPPROPRIATETYPE;
ghc_errstr = "inappropriate NFS file type or format";
break;
case GHC_EHOSTDOWN:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "destination host down";
break;
case GHC_EHOSTUNREACH:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "remote host is unreachable";
break;
case GHC_EIDRM:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "IPC identifier removed";
break;
case GHC_EILSEQ:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "invalid wide character";
break;
case GHC_EINPROGRESS:
ghc_errtype = ERR_ALREADYEXISTS;
ghc_errstr = "operation now in progress";
break;
case GHC_EINTR:
ghc_errtype = ERR_INTERRUPTED;
ghc_errstr = "interrupted system call";
break;
case GHC_EINVAL:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "invalid argument";
break;
case GHC_EIO:
ghc_errtype = ERR_HARDWAREFAULT;
ghc_errstr = "unknown I/O fault";
break;
case GHC_EISCONN:
ghc_errtype = ERR_ALREADYEXISTS;
ghc_errstr = "socket is already connected";
break;
case GHC_EISDIR:
ghc_errtype = ERR_INAPPROPRIATETYPE;
ghc_errstr = "file is a directory";
break;
case GHC_ELOOP:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "too many symbolic links";
break;
case GHC_EMFILE:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "process file table full";
break;
case GHC_EMLINK:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "too many links";
break;
case GHC_EMSGSIZE:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "message too long";
break;
case GHC_EMULTIHOP:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "multi-hop RFS request";
break;
case GHC_ENAMETOOLONG:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "filename too long";
break;
case GHC_ENETDOWN:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "network is down";
break;
case GHC_ENETRESET:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "remote host rebooted; connection lost";
break;
case GHC_ENETUNREACH:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "remote network is unreachable";
break;
case GHC_ENFILE:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "system file table full";
break;
case GHC_ENOBUFS:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "no buffer space available";
break;
case GHC_ENODATA:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no message on the stream head read queue";
break;
case GHC_ENODEV:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no such device";
break;
case GHC_ENOENT:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no such file or directory";
break;
case GHC_ENOEXEC:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "not an executable file";
break;
case GHC_ENOLCK:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "no file locks available";
break;
case GHC_ENOLINK:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "RFS link has been severed";
break;
case GHC_ENOMEM:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "not enough virtual memory";
break;
case GHC_ENOMSG:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no message of desired type";
break;
case GHC_ENONET:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "host is not on a network";
break;
case GHC_ENOPROTOOPT:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "operation not supported by protocol";
break;
case GHC_ENOSPC:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "no space left on device";
break;
case GHC_ENOSR:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "out of stream resources";
break;
case GHC_ENOSTR:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "not a stream device";
break;
case GHC_ENOSYS:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "function not implemented";
break;
case GHC_ENOTBLK:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "not a block device";
break;
case GHC_ENOTCONN:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "socket is not connected";
break;
case GHC_ENOTDIR:
ghc_errtype = ERR_INAPPROPRIATETYPE;
ghc_errstr = "not a directory";
break;
case GHC_ENOTEMPTY:
ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
ghc_errstr = "directory not empty";
break;
case GHC_ENOTSOCK:
ghc_errtype = ERR_INVALIDARGUMENT;
ghc_errstr = "not a socket";
break;
case GHC_ENOTTY:
ghc_errtype = ERR_ILLEGALOPERATION;
ghc_errstr = "inappropriate ioctl for device";
break;
case GHC_ENXIO:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no such device or address";
break;
case GHC_EOPNOTSUPP:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "operation not supported on socket";
break;
case GHC_EPERM:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "privileged operation";
break;
case GHC_EPFNOSUPPORT:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "protocol family not supported";
break;
case GHC_EPIPE:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "broken pipe";
break;
case GHC_EPROCLIM:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "too many processes";
break;
case GHC_EPROCUNAVAIL:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "unimplemented RPC procedure";
break;
case GHC_EPROGMISMATCH:
ghc_errtype = ERR_PROTOCOLERROR;
ghc_errstr = "unsupported RPC program version";
break;
case GHC_EPROGUNAVAIL:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "RPC program unavailable";
break;
case GHC_EPROTO:
ghc_errtype = ERR_PROTOCOLERROR;
ghc_errstr = "error in streams protocol";
break;
case GHC_EPROTONOSUPPORT:
ghc_errtype = ERR_PROTOCOLERROR;
ghc_errstr = "protocol not supported";
break;
case GHC_EPROTOTYPE:
ghc_errtype = ERR_PROTOCOLERROR;
ghc_errstr = "wrong protocol for socket";
break;
case GHC_ERANGE:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "result too large";
break;
case GHC_EREMCHG:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "remote address changed";
break;
case GHC_EREMOTE:
ghc_errtype = ERR_ILLEGALOPERATION;
ghc_errstr = "too many levels of remote in path";
break;
case GHC_EROFS:
ghc_errtype = ERR_PERMISSIONDENIED;
ghc_errstr = "read-only file system";
break;
case GHC_ERPCMISMATCH:
ghc_errtype = ERR_PROTOCOLERROR;
ghc_errstr = "RPC version is wrong";
break;
case GHC_ERREMOTE:
ghc_errtype = ERR_ILLEGALOPERATION;
ghc_errstr = "object is remote";
break;
case GHC_ESHUTDOWN:
ghc_errtype = ERR_ILLEGALOPERATION;
ghc_errstr = "can't send after socket shutdown";
break;
case GHC_ESOCKTNOSUPPORT:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "socket type not supported";
break;
case GHC_ESPIPE:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "can't seek on a pipe";
break;
case GHC_ESRCH:
ghc_errtype = ERR_NOSUCHTHING;
ghc_errstr = "no such process";
break;
case GHC_ESRMNT:
ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
ghc_errstr = "RFS resources still mounted by remote host(s)";
break;
case GHC_ESTALE:
ghc_errtype = ERR_RESOURCEVANISHED;
ghc_errstr = "stale NFS file handle";
break;
case GHC_ETIME:
ghc_errtype = ERR_TIMEEXPIRED;
ghc_errstr = "timer expired";
break;
case GHC_ETIMEDOUT:
ghc_errtype = ERR_TIMEEXPIRED;
ghc_errstr = "connection timed out";
break;
case GHC_ETOOMANYREFS:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "too many references; can't splice";
break;
case GHC_ETXTBSY:
ghc_errtype = ERR_RESOURCEBUSY;
ghc_errstr = "text file in-use";
break;
case GHC_EUSERS:
ghc_errtype = ERR_RESOURCEEXHAUSTED;
ghc_errstr = "quota table full";
break;
case GHC_EWOULDBLOCK:
ghc_errtype = ERR_OTHERERROR;
ghc_errstr = "operation would block";
break;
case GHC_EXDEV:
ghc_errtype = ERR_UNSUPPORTEDOPERATION;
ghc_errstr = "can't make a cross-device link";
break;
}
}
\end{code}
|