• TCP/IP 错误号


    下表列出了 Linux, UNIX 系统上的常见 TCP/IP 错误符号 (errnos)。

     Linux 操作系统,可在 /usr/include/asm/errno.h ,或/usr/include/asm-generic/errno-base.h文件中找到 TCP/IP 错误的完整列表。

    表 1. TCP/IP 错误号

    错误代码

    Linux 错误号

    描述

    EINTR4指定的函数被信号中断。
    EBADF9套接字错误。 套接字可能已损坏。
    EAGAIN11资源暂时不可用。
    EFAULT14地址错误。

    在连接时,使用了错误地址。

    在接收时,数据被定向到不存在的或受保护的进程地址空间部分。 缓冲区无效。

    EBUSY16资源正忙。
    EINVAL22传递至指定函数或套接字的无效自变量已关闭。 如果存在内存覆盖或缓存溢出问题,那么可能返回 EINVAL 错误。
    ENFILE23系统中打开的文件太多。
    EMFILE24每进程文件描述符表已满。 已超出进程的文件描述符/套接字数。
    ENOSPC28设备或系统表上未余下任何空间。
    EPIPE32管道中断。
    EWOULDBLOCK11在连接函数上,分配给 TCP/UDP 临时端口的范围已用完。 (某些操作系统将同一错误返回为 EAGAIN。)
    ENOTSOCK88对非套接字执行了套接字操作。
    ENOPROTOOPT92选项未知。
    EADDRINUSE98已经在使用指定的地址。 建立该连接的先前进程可能异常终止或未正确清除。
    EADDRNOTAVAIL99不能从本地系统获取指定的主机名或 IP 地址。
    ENETDOWN100网络已停止。
    ENETUNREACH101没有任何至网络或主机的路由可用。
    ENETRESET102网络在重置时删除了该连接。
    ECONNRESET104合作伙伴已重置连接。
    ENOBUFS105系统中没有足够的内存或资源可用来完成调用。
    EISCONN106已连接该套接字。
    ENOTCONN107未连接套接字。
    ETIMEDOUT110连接已超时。
    ECONNREFUSED111连接被拒绝。 如果您尝试连接至数据库,请检查服务器上的数据库管理器和 TCP/IP 协议支持是否已成功启动。

    如果指定了 SOCKS 协议支持,那么还必须确保 SOCKS 服务器上的 TCP/IP 协议支持已成功启动。

    EHOSTDOWN112主机已当机。
    EHOSTUNREACH113没有任何至主机的可用路由。
    1. #include
    2. #define EDEADLK 35 /* Resource deadlock would occur */
    3. #define ENAMETOOLONG 36 /* File name too long */
    4. #define ENOLCK 37 /* No record locks available */
    5. /*
    6. * This error code is special: arch syscall entry code will return
    7. * -ENOSYS if users try to call a syscall that doesn't exist. To keep
    8. * failures of syscalls that really do exist distinguishable from
    9. * failures due to attempts to use a nonexistent syscall, syscall
    10. * implementations should refrain from returning -ENOSYS.
    11. */
    12. #define ENOSYS 38 /* Invalid system call number */
    13. #define ENOTEMPTY 39 /* Directory not empty */
    14. #define ELOOP 40 /* Too many symbolic links encountered */
    15. #define EWOULDBLOCK EAGAIN /* Operation would block */
    16. #define ENOMSG 42 /* No message of desired type */
    17. #define EIDRM 43 /* Identifier removed */
    18. #define ECHRNG 44 /* Channel number out of range */
    19. #define EL2NSYNC 45 /* Level 2 not synchronized */
    20. #define EL3HLT 46 /* Level 3 halted */
    21. #define EL3RST 47 /* Level 3 reset */
    22. #define ELNRNG 48 /* Link number out of range */
    23. #define EUNATCH 49 /* Protocol driver not attached */
    24. #define ENOCSI 50 /* No CSI structure available */
    25. #define EL2HLT 51 /* Level 2 halted */
    26. #define EBADE 52 /* Invalid exchange */
    27. #define EBADR 53 /* Invalid request descriptor */
    28. #define EXFULL 54 /* Exchange full */
    29. #define ENOANO 55 /* No anode */
    30. #define EBADRQC 56 /* Invalid request code */
    31. #define EBADSLT 57 /* Invalid slot */
    32. #define EDEADLOCK EDEADLK
    33. #define EBFONT 59 /* Bad font file format */
    34. #define ENOSTR 60 /* Device not a stream */
    35. #define ENODATA 61 /* No data available */
    36. #define ETIME 62 /* Timer expired */
    37. #define ENOSR 63 /* Out of streams resources */
    38. #define ENONET 64 /* Machine is not on the network */
    39. #define ENOPKG 65 /* Package not installed */
    40. #define EREMOTE 66 /* Object is remote */
    41. #define ENOLINK 67 /* Link has been severed */
    42. #define EADV 68 /* Advertise error */
    43. #define ESRMNT 69 /* Srmount error */
    44. #define ECOMM 70 /* Communication error on send */
    45. #define EPROTO 71 /* Protocol error */
    46. #define EMULTIHOP 72 /* Multihop attempted */
    47. #define EDOTDOT 73 /* RFS specific error */
    48. #define EBADMSG 74 /* Not a data message */
    49. #define EOVERFLOW 75 /* Value too large for defined data type */
    50. #define ENOTUNIQ 76 /* Name not unique on network */
    51. #define EBADFD 77 /* File descriptor in bad state */
    52. #define EREMCHG 78 /* Remote address changed */
    53. #define ELIBACC 79 /* Can not access a needed shared library */
    54. #define ELIBBAD 80 /* Accessing a corrupted shared library */
    55. #define ELIBSCN 81 /* .lib section in a.out corrupted */
    56. #define ELIBMAX 82 /* Attempting to link in too many shared libraries */
    57. #define ELIBEXEC 83 /* Cannot exec a shared library directly */
    58. #define EILSEQ 84 /* Illegal byte sequence */
    59. #define ERESTART 85 /* Interrupted system call should be restarted */
    60. #define ESTRPIPE 86 /* Streams pipe error */
    61. #define EUSERS 87 /* Too many users */
    62. #define ENOTSOCK 88 /* Socket operation on non-socket */
    63. #define EDESTADDRREQ 89 /* Destination address required */
    64. #define EMSGSIZE 90 /* Message too long */
    65. #define EPROTOTYPE 91 /* Protocol wrong type for socket */
    66. #define ENOPROTOOPT 92 /* Protocol not available */
    67. #define EPROTONOSUPPORT 93 /* Protocol not supported */
    68. #define ESOCKTNOSUPPORT 94 /* Socket type not supported */
    69. #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
    70. #define EPFNOSUPPORT 96 /* Protocol family not supported */
    71. #define EAFNOSUPPORT 97 /* Address family not supported by protocol */
    72. #define EADDRINUSE 98 /* Address already in use */
    73. #define EADDRNOTAVAIL 99 /* Cannot assign requested address */
    74. #define ENETDOWN 100 /* Network is down */
    75. #define ENETUNREACH 101 /* Network is unreachable */
    76. #define ENETRESET 102 /* Network dropped connection because of reset */
    77. #define ECONNABORTED 103 /* Software caused connection abort */
    78. #define ECONNRESET 104 /* Connection reset by peer */
    79. #define ENOBUFS 105 /* No buffer space available */
    80. #define EISCONN 106 /* Transport endpoint is already connected */
    81. #define ENOTCONN 107 /* Transport endpoint is not connected */
    82. #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
    83. #define ETOOMANYREFS 109 /* Too many references: cannot splice */
    84. #define ETIMEDOUT 110 /* Connection timed out */
    85. #define ECONNREFUSED 111 /* Connection refused */
    86. #define EHOSTDOWN 112 /* Host is down */
    87. #define EHOSTUNREACH 113 /* No route to host */
    88. #define EALREADY 114 /* Operation already in progress */
    89. #define EINPROGRESS 115 /* Operation now in progress */
    90. #define ESTALE 116 /* Stale file handle */
    91. #define EUCLEAN 117 /* Structure needs cleaning */
    92. #define ENOTNAM 118 /* Not a XENIX named type file */
    93. #define ENAVAIL 119 /* No XENIX semaphores available */
    94. #define EISNAM 120 /* Is a named type file */
    95. #define EREMOTEIO 121 /* Remote I/O error */
    96. #define EDQUOT 122 /* Quota exceeded */
    97. #define ENOMEDIUM 123 /* No medium found */
    98. #define EMEDIUMTYPE 124 /* Wrong medium type */
    99. #define ECANCELED 125 /* Operation Canceled */
    100. #define ENOKEY 126 /* Required key not available */
    101. #define EKEYEXPIRED 127 /* Key has expired */
    102. #define EKEYREVOKED 128 /* Key has been revoked */
    103. #define EKEYREJECTED 129 /* Key was rejected by service */
    104. /* for robust mutexes */
    105. #define EOWNERDEAD 130 /* Owner died */
    106. #define ENOTRECOVERABLE 131 /* State not recoverable */
    107. #define ERFKILL 132 /* Operation not possible due to RF-kill */
    108. #define EHWPOISON 133 /* Memory page has hardware error */
    109. #endif

  • 相关阅读:
    【医学影像】LIDC-IDRI数据集的无痛制作
    服务器正文22:linux内核网络模块笔记:理解TCP连接建立过程、一条TCP连接多大内存、一台机器最多支持多少条TCP连接、网络优化建议(下)
    数组知识点以及leetcode刷题
    048-第三代软件开发-数据回放
    Linux:【Kafka四】集群介绍与单机搭建
    实现第三方app开机自启
    JAVA语言学习-面向对象(1)
    华为机考:HJ43 迷宫问题
    jvm学习路线(简洁明了)
    运维监控系统 PIGOSS BSM 拓扑自动发现原理
  • 原文地址:https://blog.csdn.net/qq_34999565/article/details/128187636