2 % (c) The GRASP/AQUA Project, Glasgow University, 1994
4 \subsection[errno.lc]{GHC Error Number Conversion}
14 char *ghc_errstr = NULL;
16 /* Collect all of the grotty #ifdef's in one place. */
18 void cvtErrno(STG_NO_ARGS)
23 ghc_errno = GHC_E2BIG;
28 ghc_errno = GHC_EACCES;
33 ghc_errno = GHC_EADDRINUSE;
38 ghc_errno = GHC_EADDRNOTAVAIL;
48 ghc_errno = GHC_EAFNOSUPPORT;
53 ghc_errno = GHC_EAGAIN;
58 ghc_errno = GHC_EALREADY;
63 ghc_errno = GHC_EBADF;
68 ghc_errno = GHC_EBADMSG;
73 ghc_errno = GHC_EBADRPC;
78 ghc_errno = GHC_EBUSY;
83 ghc_errno = GHC_ECHILD;
88 ghc_errno = GHC_ECOMM;
93 ghc_errno = GHC_ECONNABORTED;
98 ghc_errno = GHC_ECONNREFUSED;
103 ghc_errno = GHC_ECONNRESET;
108 ghc_errno = GHC_EDEADLK;
113 ghc_errno = GHC_EDESTADDRREQ;
118 ghc_errno = GHC_EDIRTY;
123 ghc_errno = GHC_EDOM;
128 ghc_errno = GHC_EDQUOT;
133 ghc_errno = GHC_EEXIST;
138 ghc_errno = GHC_EFAULT;
143 ghc_errno = GHC_EFBIG;
148 ghc_errno = GHC_EFTYPE;
153 ghc_errno = GHC_EHOSTDOWN;
158 ghc_errno = GHC_EHOSTUNREACH;
163 ghc_errno = GHC_EIDRM;
168 ghc_errno = GHC_EILSEQ;
173 ghc_errno = GHC_EINPROGRESS;
178 ghc_errno = GHC_EINTR;
183 ghc_errno = GHC_EINVAL;
193 ghc_errno = GHC_EISCONN;
198 ghc_errno = GHC_EISDIR;
203 ghc_errno = GHC_ELOOP;
208 ghc_errno = GHC_EMFILE;
213 ghc_errno = GHC_EMLINK;
218 ghc_errno = GHC_EMSGSIZE;
223 ghc_errno = GHC_EMULTIHOP;
228 ghc_errno = GHC_ENAMETOOLONG;
233 ghc_errno = GHC_ENETDOWN;
238 ghc_errno = GHC_ENETRESET;
243 ghc_errno = GHC_ENETUNREACH;
248 ghc_errno = GHC_ENFILE;
253 ghc_errno = GHC_ENOBUFS;
258 ghc_errno = GHC_ENODATA;
263 ghc_errno = GHC_ENODEV;
268 ghc_errno = GHC_ENOENT;
273 ghc_errno = GHC_ENOEXEC;
278 ghc_errno = GHC_ENOLCK;
283 ghc_errno = GHC_ENOLINK;
288 ghc_errno = GHC_ENOMEM;
293 ghc_errno = GHC_ENOMSG;
298 ghc_errno = GHC_ENONET;
303 ghc_errno = GHC_ENOPROTOOPT;
308 ghc_errno = GHC_ENOSPC;
313 ghc_errno = GHC_ENOSR;
318 ghc_errno = GHC_ENOSTR;
323 ghc_errno = GHC_ENOSYS;
328 ghc_errno = GHC_ENOTBLK;
333 ghc_errno = GHC_ENOTCONN;
338 ghc_errno = GHC_ENOTDIR;
343 ghc_errno = GHC_ENOTEMPTY;
348 ghc_errno = GHC_ENOTSOCK;
353 ghc_errno = GHC_ENOTTY;
358 ghc_errno = GHC_ENXIO;
363 ghc_errno = GHC_EOPNOTSUPP;
368 ghc_errno = GHC_EPERM;
373 ghc_errno = GHC_EPFNOSUPPORT;
378 ghc_errno = GHC_EPIPE;
383 ghc_errno = GHC_EPROCLIM;
388 ghc_errno = GHC_EPROCUNAVAIL;
393 ghc_errno = GHC_EPROGMISMATCH;
398 ghc_errno = GHC_EPROGUNAVAIL;
403 ghc_errno = GHC_EPROTO;
406 #ifdef EPROTONOSUPPORT
407 case EPROTONOSUPPORT:
408 ghc_errno = GHC_EPROTONOSUPPORT;
413 ghc_errno = GHC_EPROTOTYPE;
418 ghc_errno = GHC_ERANGE;
423 ghc_errno = GHC_EREMCHG;
428 ghc_errno = GHC_EREMOTE;
433 ghc_errno = GHC_EROFS;
438 ghc_errno = GHC_ERPCMISMATCH;
443 ghc_errno = GHC_ERREMOTE;
448 ghc_errno = GHC_ESHUTDOWN;
451 #ifdef ESOCKTNOSUPPORT
452 case ESOCKTNOSUPPORT:
453 ghc_errno = GHC_ESOCKTNOSUPPORT;
458 ghc_errno = GHC_ESPIPE;
463 ghc_errno = GHC_ESRCH;
468 ghc_errno = GHC_ESRMNT;
473 ghc_errno = GHC_ESTALE;
478 ghc_errno = GHC_ETIME;
483 ghc_errno = GHC_ETIMEDOUT;
488 ghc_errno = GHC_ETOOMANYREFS;
493 ghc_errno = GHC_ETXTBSY;
498 ghc_errno = GHC_EUSERS;
504 ghc_errno = GHC_EWOULDBLOCK;
510 ghc_errno = GHC_EXDEV;
520 stdErrno(STG_NO_ARGS)
524 ghc_errtype = ERR_OTHERERROR;
525 ghc_errstr = "unexpected error";
528 ghc_errtype = ERR_OTHERERROR;
529 ghc_errstr = "no error";
531 ghc_errtype = ERR_RESOURCEEXHAUSTED;
532 ghc_errstr = "argument list too long";
535 ghc_errtype = ERR_PERMISSIONDENIED;
536 ghc_errstr = "inadequate access permission";
539 ghc_errtype = ERR_RESOURCEBUSY;
540 ghc_errstr = "address already in use";
542 case GHC_EADDRNOTAVAIL:
543 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
544 ghc_errstr = "address not available";
547 ghc_errtype = ERR_OTHERERROR;
548 ghc_errstr = "RFS advertise error";
550 case GHC_EAFNOSUPPORT:
551 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
552 ghc_errstr = "address family not supported by protocol family";
555 ghc_errtype = ERR_RESOURCEEXHAUSTED;
556 ghc_errstr = "insufficient resources";
559 ghc_errtype = ERR_ALREADYEXISTS;
560 ghc_errstr = "operation already in progress";
563 ghc_errtype = ERR_OTHERERROR;
564 ghc_errstr = "internal error (EBADF)";
567 ghc_errtype = ERR_INAPPROPRIATETYPE;
568 ghc_errstr = "next message has wrong type";
571 ghc_errtype = ERR_OTHERERROR;
572 ghc_errstr = "invalid RPC request or response";
575 ghc_errtype = ERR_RESOURCEBUSY;
576 ghc_errstr = "device busy";
579 ghc_errtype = ERR_NOSUCHTHING;
580 ghc_errstr = "no child processes";
583 ghc_errtype = ERR_RESOURCEVANISHED;
584 ghc_errstr = "no virtual circuit could be found";
586 case GHC_ECONNABORTED:
587 ghc_errtype = ERR_OTHERERROR;
588 ghc_errstr = "aborted connection";
590 case GHC_ECONNREFUSED:
591 ghc_errtype = ERR_NOSUCHTHING;
592 ghc_errstr = "no listener on remote host";
595 ghc_errtype = ERR_RESOURCEVANISHED;
596 ghc_errstr = "connection reset by peer";
599 ghc_errtype = ERR_RESOURCEBUSY;
600 ghc_errstr = "resource deadlock avoided";
602 case GHC_EDESTADDRREQ:
603 ghc_errtype = ERR_INVALIDARGUMENT;
604 ghc_errstr = "destination address required";
607 ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
608 ghc_errstr = "file system dirty";
611 ghc_errtype = ERR_INVALIDARGUMENT;
612 ghc_errstr = "argument too large";
615 ghc_errtype = ERR_PERMISSIONDENIED;
616 ghc_errstr = "quota exceeded";
619 ghc_errtype = ERR_ALREADYEXISTS;
620 ghc_errstr = "file already exists";
623 ghc_errtype = ERR_OTHERERROR;
624 ghc_errstr = "internal error (EFAULT)";
627 ghc_errtype = ERR_PERMISSIONDENIED;
628 ghc_errstr = "file too large";
631 ghc_errtype = ERR_INAPPROPRIATETYPE;
632 ghc_errstr = "inappropriate NFS file type or format";
635 ghc_errtype = ERR_NOSUCHTHING;
636 ghc_errstr = "destination host down";
638 case GHC_EHOSTUNREACH:
639 ghc_errtype = ERR_NOSUCHTHING;
640 ghc_errstr = "remote host is unreachable";
643 ghc_errtype = ERR_RESOURCEVANISHED;
644 ghc_errstr = "IPC identifier removed";
647 ghc_errtype = ERR_INVALIDARGUMENT;
648 ghc_errstr = "invalid wide character";
650 case GHC_EINPROGRESS:
651 ghc_errtype = ERR_ALREADYEXISTS;
652 ghc_errstr = "operation now in progress";
655 ghc_errtype = ERR_INTERRUPTED;
656 ghc_errstr = "interrupted system call";
659 ghc_errtype = ERR_INVALIDARGUMENT;
660 ghc_errstr = "invalid argument";
663 ghc_errtype = ERR_HARDWAREFAULT;
664 ghc_errstr = "unknown I/O fault";
667 ghc_errtype = ERR_ALREADYEXISTS;
668 ghc_errstr = "socket is already connected";
671 ghc_errtype = ERR_INAPPROPRIATETYPE;
672 ghc_errstr = "file is a directory";
675 ghc_errtype = ERR_INVALIDARGUMENT;
676 ghc_errstr = "too many symbolic links";
679 ghc_errtype = ERR_RESOURCEEXHAUSTED;
680 ghc_errstr = "process file table full";
683 ghc_errtype = ERR_RESOURCEEXHAUSTED;
684 ghc_errstr = "too many links";
687 ghc_errtype = ERR_RESOURCEEXHAUSTED;
688 ghc_errstr = "message too long";
691 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
692 ghc_errstr = "multi-hop RFS request";
694 case GHC_ENAMETOOLONG:
695 ghc_errtype = ERR_INVALIDARGUMENT;
696 ghc_errstr = "filename too long";
699 ghc_errtype = ERR_RESOURCEVANISHED;
700 ghc_errstr = "network is down";
703 ghc_errtype = ERR_RESOURCEVANISHED;
704 ghc_errstr = "remote host rebooted; connection lost";
706 case GHC_ENETUNREACH:
707 ghc_errtype = ERR_NOSUCHTHING;
708 ghc_errstr = "remote network is unreachable";
711 ghc_errtype = ERR_RESOURCEEXHAUSTED;
712 ghc_errstr = "system file table full";
715 ghc_errtype = ERR_RESOURCEEXHAUSTED;
716 ghc_errstr = "no buffer space available";
719 ghc_errtype = ERR_NOSUCHTHING;
720 ghc_errstr = "no message on the stream head read queue";
723 ghc_errtype = ERR_NOSUCHTHING;
724 ghc_errstr = "no such device";
727 ghc_errtype = ERR_NOSUCHTHING;
728 ghc_errstr = "no such file or directory";
731 ghc_errtype = ERR_INVALIDARGUMENT;
732 ghc_errstr = "not an executable file";
735 ghc_errtype = ERR_RESOURCEEXHAUSTED;
736 ghc_errstr = "no file locks available";
739 ghc_errtype = ERR_RESOURCEVANISHED;
740 ghc_errstr = "RFS link has been severed";
743 ghc_errtype = ERR_RESOURCEEXHAUSTED;
744 ghc_errstr = "not enough virtual memory";
747 ghc_errtype = ERR_NOSUCHTHING;
748 ghc_errstr = "no message of desired type";
751 ghc_errtype = ERR_NOSUCHTHING;
752 ghc_errstr = "host is not on a network";
754 case GHC_ENOPROTOOPT:
755 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
756 ghc_errstr = "operation not supported by protocol";
759 ghc_errtype = ERR_RESOURCEEXHAUSTED;
760 ghc_errstr = "no space left on device";
763 ghc_errtype = ERR_RESOURCEEXHAUSTED;
764 ghc_errstr = "out of stream resources";
767 ghc_errtype = ERR_INVALIDARGUMENT;
768 ghc_errstr = "not a stream device";
771 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
772 ghc_errstr = "function not implemented";
775 ghc_errtype = ERR_INVALIDARGUMENT;
776 ghc_errstr = "not a block device";
779 ghc_errtype = ERR_INVALIDARGUMENT;
780 ghc_errstr = "socket is not connected";
783 ghc_errtype = ERR_INAPPROPRIATETYPE;
784 ghc_errstr = "not a directory";
787 ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
788 ghc_errstr = "directory not empty";
791 ghc_errtype = ERR_INVALIDARGUMENT;
792 ghc_errstr = "not a socket";
795 ghc_errtype = ERR_ILLEGALOPERATION;
796 ghc_errstr = "inappropriate ioctl for device";
799 ghc_errtype = ERR_NOSUCHTHING;
800 ghc_errstr = "no such device or address";
803 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
804 ghc_errstr = "operation not supported on socket";
807 ghc_errtype = ERR_PERMISSIONDENIED;
808 ghc_errstr = "privileged operation";
810 case GHC_EPFNOSUPPORT:
811 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
812 ghc_errstr = "protocol family not supported";
815 ghc_errtype = ERR_RESOURCEVANISHED;
816 ghc_errstr = "broken pipe";
819 ghc_errtype = ERR_PERMISSIONDENIED;
820 ghc_errstr = "too many processes";
822 case GHC_EPROCUNAVAIL:
823 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
824 ghc_errstr = "unimplemented RPC procedure";
826 case GHC_EPROGMISMATCH:
827 ghc_errtype = ERR_PROTOCOLERROR;
828 ghc_errstr = "unsupported RPC program version";
830 case GHC_EPROGUNAVAIL:
831 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
832 ghc_errstr = "RPC program unavailable";
835 ghc_errtype = ERR_PROTOCOLERROR;
836 ghc_errstr = "error in streams protocol";
838 case GHC_EPROTONOSUPPORT:
839 ghc_errtype = ERR_PROTOCOLERROR;
840 ghc_errstr = "protocol not supported";
843 ghc_errtype = ERR_PROTOCOLERROR;
844 ghc_errstr = "wrong protocol for socket";
847 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
848 ghc_errstr = "result too large";
851 ghc_errtype = ERR_RESOURCEVANISHED;
852 ghc_errstr = "remote address changed";
855 ghc_errtype = ERR_ILLEGALOPERATION;
856 ghc_errstr = "too many levels of remote in path";
859 ghc_errtype = ERR_PERMISSIONDENIED;
860 ghc_errstr = "read-only file system";
862 case GHC_ERPCMISMATCH:
863 ghc_errtype = ERR_PROTOCOLERROR;
864 ghc_errstr = "RPC version is wrong";
867 ghc_errtype = ERR_ILLEGALOPERATION;
868 ghc_errstr = "object is remote";
871 ghc_errtype = ERR_ILLEGALOPERATION;
872 ghc_errstr = "can't send after socket shutdown";
874 case GHC_ESOCKTNOSUPPORT:
875 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
876 ghc_errstr = "socket type not supported";
879 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
880 ghc_errstr = "can't seek on a pipe";
883 ghc_errtype = ERR_NOSUCHTHING;
884 ghc_errstr = "no such process";
887 ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
888 ghc_errstr = "RFS resources still mounted by remote host(s)";
891 ghc_errtype = ERR_RESOURCEVANISHED;
892 ghc_errstr = "stale NFS file handle";
895 ghc_errtype = ERR_TIMEEXPIRED;
896 ghc_errstr = "timer expired";
899 ghc_errtype = ERR_TIMEEXPIRED;
900 ghc_errstr = "connection timed out";
902 case GHC_ETOOMANYREFS:
903 ghc_errtype = ERR_RESOURCEEXHAUSTED;
904 ghc_errstr = "too many references; can't splice";
907 ghc_errtype = ERR_RESOURCEBUSY;
908 ghc_errstr = "text file in-use";
911 ghc_errtype = ERR_RESOURCEEXHAUSTED;
912 ghc_errstr = "quota table full";
914 case GHC_EWOULDBLOCK:
915 ghc_errtype = ERR_OTHERERROR;
916 ghc_errstr = "operation would block";
919 ghc_errtype = ERR_UNSUPPORTEDOPERATION;
920 ghc_errstr = "can't make a cross-device link";