607 const char* LastErrNo(int status)
608 {
609 #ifdef linux
610 switch(status)
611 {
612 case ESUCCESS: return("ESUCCESS"); break;
613 case EPERM: return("EPERM"); break;
614 case ENOENT: return("ENOENT"); break;
615 case ESRCH: return("ESRCH"); break;
616 case EINTR: return("EINTR"); break;
617 case EIO: return("EIO"); break;
618 case ENXIO: return("ENXIO"); break;
619 case E2BIG: return("E2BIG"); break;
620 case ENOEXEC: return("ENOEXEC"); break;
621 case EBADF: return("EBADF"); break;
622 case ECHILD: return("ECHILD"); break;
623 case EDEADLK: return("EDEADLK"); break;
624 case ENOMEM: return("ENOMEM"); break;
625 case EACCES: return("EACCES"); break;
626 case EFAULT: return("EFAULT"); break;
627 case ENOTBLK: return("ENOTBLK"); break;
628 case EBUSY: return("EBUSY"); break;
629 case EEXIST: return("EEXIST"); break;
630 case EXDEV: return("EXDEV"); break;
631 case ENODEV: return("ENODEV"); break;
632 case ENOTDIR: return("ENOTDIR"); break;
633 case EISDIR: return("EISDIR"); break;
634 case EINVAL: return("EINVAL"); break;
635 case ENFILE: return("ENFILE"); break;
636 case EMFILE: return("EMFILE"); break;
637 case ENOTTY: return("ENOTTY"); break;
638 case ETXTBSY: return("ETXTBSY"); break;
639 case EFBIG: return("EFBIG"); break;
640 case ENOSPC: return("ENOSPC"); break;
641 case ESPIPE: return("ESPIPE"); break;
642 case EROFS: return("EROFS"); break;
643 case EMLINK: return("EMLINK"); break;
644 case EPIPE: return("EPIPE"); break;
645 case EDOM: return("EDOM"); break;
646 case ERANGE: return("ERANGE"); break;
647 case EWOULDBLOCK: return("EWOULDBLOCK"); break;
648 // case EAGAIN: return("EAGAIN"); break;
649 case EINPROGRESS: return("EINPROGRESS"); break;
650 case EALREADY: return("EALREADY"); break;
651 case ENOTSOCK: return("ENOTSOCK"); break;
652 case EDESTADDRREQ: return("EDESTADDRREQ"); break;
653 case EMSGSIZE: return("EMSGSIZE"); break;
654 case EPROTOTYPE: return("EPROTOTYPE"); break;
655 case ENOPROTOOPT: return("ENOPROTOOPT"); break;
656 case EPROTONOSUPPORT: return("EPROTONOSUPPORT"); break;
657 case ESOCKTNOSUPPORT: return("ESOCKTNOSUPPORT"); break;
658 case EOPNOTSUPP: return("EOPNOTSUPP"); break;
659 case EPFNOSUPPORT: return("EPFNOSUPPORT"); break;
660 case EAFNOSUPPORT: return("EAFNOSUPPORT"); break;
661 case EADDRINUSE: return("EADDRINUSE"); break;
662 case EADDRNOTAVAIL: return("EADDRNOTAVAIL"); break;
663 case ENETDOWN: return("ENETDOWN"); break;
664 case ENETUNREACH: return("ENETUNREACH"); break;
665 case ENETRESET: return("ENETRESET"); break;
666 case ECONNABORTED: return("ECONNABORTED"); break;
667 case ECONNRESET: return("ECONNRESET"); break;
668 case ENOBUFS: return("ENOBUFS"); break;
669 case EISCONN: return("EISCONN"); break;
670 case ENOTCONN: return("ENOTCONN"); break;
671 case ESHUTDOWN: return("ESHUTDOWN"); break;
672 case ETOOMANYREFS: return("ETOOMANYREFS"); break;
673 case ETIMEDOUT: return("ETIMEDOUT"); break;
674 case ECONNREFUSED: return("ECONNREFUSED"); break;
675 case ELOOP: return("ELOOP"); break;
676 case ENAMETOOLONG: return("ENAMETOOLONG"); break;
677 case EHOSTDOWN: return("EHOSTDOWN"); break;
678 case EHOSTUNREACH: return("EHOSTUNREACH"); break;
679 case ENOTEMPTY: return("ENOTEMPTY"); break;
680 //case EPROCLIM: return("EPROCLIM"); break;
681 case EUSERS: return("EUSERS"); break;
682 case EDQUOT: return("EDQUOT"); break;
683 case ESTALE: return("ESTALE"); break;
684 case EREMOTE: return("EREMOTE"); break;
685 // case EBADRPC: return("EBADRPC"); break;
686 // case ERPCMISMATCH: return("ERPCMISMATCH"); break;
687 // case EPROGUNAVAIL: return("EPROGUNAVAIL"); break;
688 // case EPROGMISMATCH: return("EPROGMISMATCH"); break;
689 // case EPROCUNAVAIL: return("EPROCUNAVAIL"); break;
690 case ENOLCK: return("ENOLCK"); break;
691 case ENOSYS: return("ENOSYS"); break;
692 // case EFTYPE: return("EFTYPE"); break;
693 case ENOMSG: return("ENOMSG"); break;
694 case EIDRM: return("EIDRM"); break;
695 case ENOSR: return("ENOSR"); break;
696 case ETIME: return("ETIME"); break;
697 case EBADMSG: return("EBADMSG"); break;
698 case EPROTO: return("EPROTO"); break;
699 case ENODATA: return("ENODATA"); break;
700 case ENOSTR: return("ENOSTR"); break;
701 // case ECLONEME: return("ECLONEME"); break;
702 // case EDIRTY: return("EDIRTY"); break;
703 // case EDUPPKG: return("EDUPPKG"); break;
704 // case EVERSION: return("EVERSION"); break;
705 case ENOPKG: return("ENOPKG"); break;
706 // case ENOSYM: return("ENOSYM"); break;
707 case ECANCELED: return("ECANCELED"); break;
708 case EFAIL: return("EFAIL"); break;
709 // case EINPROG: return("EINPROG"); break;
710 // case EMTIMERS: return("EMTIMERS"); break;
711 // case ENOTSUP: return("ENOTSUP"); break;
712 // case EAIO: return("EAIO"); break;
713 // case EMULTIHOP: return("EMULTIHOP"); break;
714 // case ENOLINK: return("ENOLINK"); break;
715 // case EOVERFLOW: return("EOVERFLOW"); break;
716 case EILSEQ: return("EILSEQ"); break;
717 // case ERESTART: return("ERESTART"); break;
718 // case EJUSTRETURN: return("EJUSTRETURN"); break;
719 // case EEMULATE: return("EEMULATE"); break;
720 default: return "UNKNOWN"; break;
721 }
147 #define EINTR 4 /* Interrupted system call. */
148 #define ENXIO 6 /* No such device or address. */
149 #define EBADF 9 /* Bad file number. */
150
151 #define EACCES 13 /* Permission denied. */
152 #define EFAULT 14 /* Bad address. */
153 #define EBUSY 16 /* Socket busy. */
154
155 #define EINVAL 22 /* Invalid argument. */
156 #define ENFILE 23 /* File table overflow. */
157
158 #define EPIPE 32 /* Broken pipe. */
159 #define EAGAIN 35 /* Resource temporarily unavailable. */
160 #define EWOULDBLOCK EAGAIN /* Operation would block. */
161 #define EINPROGRESS 36 /* Operation now in progress. */
162 #define EALREADY 37 /* Operation already in progress. */
163 #define EDESTADDRREQ 39 /* Destination address required. */
164
165 #define EMSGSIZE 40 /* Message too long. */
166 #define EPROTOTYPE 41 /* Protocol wrong type for socket. */
167 #define ENOPROTOOPT 42 /* Protocol not available. */
168 #define EPROTONOSUPPORT 43 /* Protocol not supported. */
169 #define EOPNOTSUPP 45 /* Operation not supported on socket. */
170 #define EAFNOSUPPORT 47 /* Address family not supported by protocol family. */
171 #define EADDRINUSE 48 /* Address already in use. */
172 #define EADDRNOTAVAIL 49 /* Can't assign requested address. */
173 #define ENETDOWN 50 /* Network is down */
174
175 #define ECONNABORTED 53 /* Software caused connection abort. */
176 #define ECONNRESET 54 /* Connection reset by peer. */
177 #define ENOBUFS 55 /* No buffer space available. */
178 #define EISCONN 56 /* Socket is already connected. */
179 #define ENOTCONN 57 /* Socket is not connected. */
180
181 #define ETIMEDOUT 60 /* Operation timed out. */
182 #define ECONNREFUSED 61 /* Connection refused. */
183 #define EHOSTUNREACH 65 /* No route to host. */
No comments:
Post a Comment