//here is os errno. //C0: int OS_MAX_ERROR_CODE -----> ob errno //C1: char *OS_ERROR_NAME[OS_MAX_ERROR_CODE] -----> store os errno name //C2: int OS_ERRNO[OS_MAX_ERROR_CODE]; -----> store os errno //C3: char *OS_ERROR_MSG[OS_MAX_ERROR_CODE]; -----> store os errno msg //DEFINE_OS_ERROR(C1, C0, C2, C3) DEFINE_OS_ERROR(OS_EPERM, -1, 1 "Operation not permitted"); DEFINE_OS_ERROR(OS_ENOENT, -2, 2, "No such file or directory"); DEFINE_OS_ERROR(OS_ESRCH, -3, 3, "No such process"); DEFINE_OS_ERROR(OS_EINTR, -4, 4, "Interrupted system call"); DEFINE_OS_ERROR(OS_EIO, -5, 5, "I/O error"); DEFINE_OS_ERROR(OS_ENXIO, -6, 6, "No such device or address"); DEFINE_OS_ERROR(OS_E2BIG, -7, 7, "Argument list too long"); DEFINE_OS_ERROR(OS_ENOEXEC, -8, 8, "Exec format error"); DEFINE_OS_ERROR(OS_EBADF, -9, 9, "Bad file number"); DEFINE_OS_ERROR(OS_ECHILD, -10, 10, "No child processes"); DEFINE_OS_ERROR(OS_EAGAIN, -11, 11, "Try again"); DEFINE_OS_ERROR(OS_ENOMEM, -12, 12, "Out of memory"); DEFINE_OS_ERROR(OS_EACCES, -13, 13, "Permission denied"); DEFINE_OS_ERROR(OS_EFAULT, -14, 14, "Bad address"); DEFINE_OS_ERROR(OS_ENOTBLK, -15, 15, "Block device required"); DEFINE_OS_ERROR(OS_EBUSY, -16, 16, "Device or resource busy"); DEFINE_OS_ERROR(OS_EEXIST, -17, 17, "File exists"); DEFINE_OS_ERROR(OS_EXDEV, -18, 18, "Cross-device link"); DEFINE_OS_ERROR(OS_ENODEV, -19, 19, "No such device"); DEFINE_OS_ERROR(OS_ENOTDIR, -20, 20, "Not a directory"); DEFINE_OS_ERROR(OS_EISDIR, -21, 21, "Is a directory"); DEFINE_OS_ERROR(OS_EINVAL, -22, 22, "Invalid argument"); DEFINE_OS_ERROR(OS_ENFILE, -23, 23, "File table overflow"); DEFINE_OS_ERROR(OS_EMFILE, -24, 24, "Too many open files"); DEFINE_OS_ERROR(OS_ENOTTY, -25, 25, "Not a typewriter"); DEFINE_OS_ERROR(OS_ETXTBSY, -26, 26, "Text file busy"); DEFINE_OS_ERROR(OS_EFBIG, -27, 27, "File too large"); DEFINE_OS_ERROR(OS_ENOSPC, -28, 28, "No space left on device"); DEFINE_OS_ERROR(OS_ESPIPE, -29, 29, "Illegal seek"); DEFINE_OS_ERROR(OS_EROFS, -30, 30, "Read-only file system"); DEFINE_OS_ERROR(OS_EMLINK, -31, 31, "Too many links"); DEFINE_OS_ERROR(OS_EPIPE, -32, 32, "Broken pipe"); DEFINE_OS_ERROR(OS_EDOM, -33, 33, "Math argument out of domain of func"); DEFINE_OS_ERROR(OS_ERANGE, -34, 34, "Math result not representable"); DEFINE_OS_ERROR(OS_EDEADLK, -35, 35, "Resource deadlock would occur"); DEFINE_OS_ERROR(OS_ENAMETOOLONG, -36, 36, "File name too long"); DEFINE_OS_ERROR(OS_ENOLCK, -37, 37, "No record locks available"); DEFINE_OS_ERROR(OS_ENOSYS, -38, 38, "Function not implemented"); DEFINE_OS_ERROR(OS_ENOTEMPTY, -39, 39, "Directory not empty"); DEFINE_OS_ERROR(OS_ELOOP, -40, 40, "Too many symbolic links encountered"); DEFINE_OS_ERROR(OS_EWOULDBLOCK, -41, 11, "Operation would block"); DEFINE_OS_ERROR(OS_ENOMSG, -42, 42, "No message of desired type"); DEFINE_OS_ERROR(OS_EIDRM, -43, 43, "Identifier removed"); DEFINE_OS_ERROR(OS_ECHRNG, -44, 44, "Channel number out of range"); DEFINE_OS_ERROR(OS_EL2NSYNC, -45, 45, "Level 2 not synchronized"); DEFINE_OS_ERROR(OS_EL3HLT, -46, 46, "Level 3 halted"); DEFINE_OS_ERROR(OS_EL3RST, -47, 47, "Level 3 reset"); DEFINE_OS_ERROR(OS_ELNRNG, -48, 48, "Link number out of range"); DEFINE_OS_ERROR(OS_EUNATCH, -49, 49, "Protocol driver not attached"); DEFINE_OS_ERROR(OS_ENOCSI, -50, 50, "No CSI structure available"); DEFINE_OS_ERROR(OS_EL2HLT, -51, 51, "Level 2 halted"); DEFINE_OS_ERROR(OS_EBADE, -52, 52, "Invalid exchange"); DEFINE_OS_ERROR(OS_EBADR, -53, 53, "Invalid request descriptor"); DEFINE_OS_ERROR(OS_EXFULL, -54, 54, "Exchange full"); DEFINE_OS_ERROR(OS_ENOANO, -55, 55, "No anode"); DEFINE_OS_ERROR(OS_EBADRQC, -56, 56, "Invalid request code"); DEFINE_OS_ERROR(OS_EBADSLT, -57, 57, "Invalid slot"); DEFINE_OS_ERROR(OS_EBFONT, -59, 59, "Bad font file format"); DEFINE_OS_ERROR(OS_ENOSTR, -60, 60, "Device not a stream"); DEFINE_OS_ERROR(OS_ENODATA, -61, 61, "No data available"); DEFINE_OS_ERROR(OS_ETIME, -62, 62, "Timer expired"); DEFINE_OS_ERROR(OS_ENOSR, -63, 63, "OOut of streams resources"); DEFINE_OS_ERROR(OS_ENONET, -64, 64, "Machine is not on the network"); DEFINE_OS_ERROR(OS_ENOPKG, -65, 65, "Package not installed"); DEFINE_OS_ERROR(OS_EREMOTE, -66, 66, "Object is remote"); DEFINE_OS_ERROR(OS_ENOLINK, -67, 67, "Link has been severed"); DEFINE_OS_ERROR(OS_EADV, -68, 68, "Advertise error"); DEFINE_OS_ERROR(OS_ESRMNT, -69, 69, "Srmount error"); DEFINE_OS_ERROR(OS_ECOMM, -70, 70, "Communication error on send"); DEFINE_OS_ERROR(OS_EPROTO, -71, 71, "Protocol error"); DEFINE_OS_ERROR(OS_EMULTIHOP, -72, 72, "Multihop attempted"); DEFINE_OS_ERROR(OS_EDOTDOT, -73, 73, "RFS specific error"); DEFINE_OS_ERROR(OS_EBADMSG, -74, 74, "Not a data message"); DEFINE_OS_ERROR(OS_EOVERFLOW, -75, 75, "Value too large for defined data type"); DEFINE_OS_ERROR(OS_ENOTUNIQ, -76, 76, "Name not unique on network"); DEFINE_OS_ERROR(OS_EBADFD, -77, 77, "File descriptor in bad state"); DEFINE_OS_ERROR(OS_EREMCHG, -78, 78, "Remote address changed"); DEFINE_OS_ERROR(OS_ELIBACC, -79, 79, "Can not access a needed shared library"); DEFINE_OS_ERROR(OS_ELIBBAD, -80, 80, "Accessing a corrupted shared library"); DEFINE_OS_ERROR(OS_ELIBSCN, -81, 81, ".lib section in a.out corrupted"); DEFINE_OS_ERROR(OS_ELIBMAX, -82, 82, "Attempting to link in too many shared libraries"); DEFINE_OS_ERROR(OS_ELIBEXEC, -83, 83, "Cannot exec a shared library directly"); DEFINE_OS_ERROR(OS_EILSEQ, -84, 84, "Illegal byte sequence"); DEFINE_OS_ERROR(OS_ERESTART, -85, 85, "Interrupted system call should be restarted"); DEFINE_OS_ERROR(OS_ESTRPIPE, -86, 86, "Streams pipe error"); DEFINE_OS_ERROR(OS_EUSERS, -87, 87, "Too many users"); DEFINE_OS_ERROR(OS_ENOTSOCK, -88, 88, "Socket operation on non-socket"); DEFINE_OS_ERROR(OS_EDESTADDRREQ, -89, 89, "Destination address required"); DEFINE_OS_ERROR(OS_EMSGSIZE, -90, 90, "Message too long"); DEFINE_OS_ERROR(OS_EPROTOTYPE, -91, 91, "Protocol wrong type for socket"); DEFINE_OS_ERROR(OS_ENOPROTOOPT, -92, 92, "Protocol not available"); DEFINE_OS_ERROR(OS_EPROTONOSUPPORT, -93, 93, "Protocol not supported"); DEFINE_OS_ERROR(OS_ESOCKTNOSUPPORT, -94, 94, "Socket type not supported"); DEFINE_OS_ERROR(OS_EOPNOTSUPP, -95, 95, "Operation not supported on transport endpoint"); DEFINE_OS_ERROR(OS_EPFNOSUPPORT, -96, 96, "Protocol family not supported"); DEFINE_OS_ERROR(OS_EAFNOSUPPORT, -97, 97, "Address family not supported by protocol"); DEFINE_OS_ERROR(OS_EADDRINUSE, -98, 98, "Address already in use"); DEFINE_OS_ERROR(OS_EADDRNOTAVAIL, -99, 99, "Cannot assign requested address"); DEFINE_OS_ERROR(OS_ENETDOWN, -100, 100, "Network is down"); DEFINE_OS_ERROR(OS_ENETUNREACH, -101, 101, "Network is unreachable"); DEFINE_OS_ERROR(OS_ENETRESET, -102, 102, "Network dropped connection because of reset"); DEFINE_OS_ERROR(OS_ECONNABORTED, -103, 103, "Software caused connection abort"); DEFINE_OS_ERROR(OS_ECONNRESET, -104, 104, "Connection reset by peer"); DEFINE_OS_ERROR(OS_ENOBUFS, -105, 105, "No buffer space available"); DEFINE_OS_ERROR(OS_EISCONN, -106, 106, "Transport endpoint is already connected"); DEFINE_OS_ERROR(OS_ENOTCONN, -107, 107, "Transport endpoint is not connected"); DEFINE_OS_ERROR(OS_ESHUTDOWN, -108, 108, "Cannot send after transport endpoint shutdown"); DEFINE_OS_ERROR(OS_ETOOMANYREFS, -109, 109, "Too many references: cannot splice"); DEFINE_OS_ERROR(OS_ETIMEDOUT, -110, 110, "Connection timed out"); DEFINE_OS_ERROR(OS_ECONNREFUSED, -111, 111, "Connection refused"); DEFINE_OS_ERROR(OS_EHOSTDOWN, -112, 112, "Host is down"); DEFINE_OS_ERROR(OS_EHOSTUNREACH, -113, 113, "No route to host"); DEFINE_OS_ERROR(OS_EALREADY, -114, 114, "Operation already in progress"); DEFINE_OS_ERROR(OS_EINPROGRESS, -115, 115, "Operation now in progress"); DEFINE_OS_ERROR(OS_ESTALE, -116, 116, "Stale file handle"); DEFINE_OS_ERROR(OS_EUCLEAN, -117, 117, "Structure needs cleaning"); DEFINE_OS_ERROR(OS_ENOTNAM, -118, 118, "Not a XENIX named type file"); DEFINE_OS_ERROR(OS_ENAVAIL, -119, 119, "No XENIX semaphores available"); DEFINE_OS_ERROR(OS_EISNAM, -120, 120, "Is a named type file"); DEFINE_OS_ERROR(OS_EREMOTEIO, -121, 121, "Remote I/O error"); DEFINE_OS_ERROR(OS_EDQUOT, -122, 122, "Quota exceeded"); DEFINE_OS_ERROR(OS_ENOMEDIUM, -123, 123, "No medium found"); DEFINE_OS_ERROR(OS_EMEDIUMTYPE, -124, 124, "Wrong medium type"); DEFINE_OS_ERROR(OS_ECANCELED, -125, 125, "Operation Canceled"); DEFINE_OS_ERROR(OS_ENOKEY, -126, 126, "Required key not available"); DEFINE_OS_ERROR(OS_EKEYEXPIRED, -127, 127, "Key has expired"); DEFINE_OS_ERROR(OS_EKEYREVOKED, -128, 128, "Key has been revoked"); DEFINE_OS_ERROR(OS_EKEYREJECTED, -129, 129, "Key was rejected by service"); DEFINE_OS_ERROR(OS_EOWNERDEAD, -130, 130, "Owner died"); DEFINE_OS_ERROR(OS_ENOTRECOVERABLE, -131, 131, "State not recoverable"); DEFINE_OS_ERROR(OS_ERFKILL, -132, 132, "Operation not possible due to RF-kill"); DEFINE_OS_ERROR(OS_EHWPOISON, -133, 133, "Memory page has hardware error");