常见的Linux系统错误码
linux中对errno是EINTR的处理

linux中对errno是EINTR的处理慢系统调用(slow system call):此术语适用于那些可能永远阻塞的系统调用。
永远阻塞的系统调用是指调用有可能永远无法返回,多数网络支持函数都属于这一类。
如:若没有客户连接到服务器上,那么服务器的accept调用就没有返回的保证。
EINTR错误的产生:当阻塞于某个慢系统调用的一个进程捕获某个信号且相应信号处理函数返回时,该系统调用可能返回一个EINTR错误。
例如:在socket服务器端,设置了信号捕获机制,有子进程,当在父进程阻塞于慢系统调用时由父进程捕获到了一个有效信号时,内核会致使accept返回一个EINTR错误(被中断的系统调用)。
当碰到EINTR错误的时候,可以采取有一些可以重启的系统调用要进行重启,而对于有一些系统调用是不能够重启的。
例如:accept、read、write、select、和open之类的函数来说,是可以进行重启的。
不过对于套接字编程中的connect 函数我们是不能重启的,若connect函数返回一个EINTR错误的时候,我们不能再次调用它,否则将立即返回一个错误。
针对connect不能重启的处理方法是,必须调用select来等待连接完成。
在 linux 或者 unix 环境中, errno 是一个十分重要的部分。
在调用的函数出现问题的时候,我们可以通过 errno 的值来确定出错的原因,这就会涉及到一个问题,那就是如何保证 errno 在多线程或者进程中安全?我们希望在多线程或者进程中,每个线程或者进程都拥有自己独立和唯一的一个 errno ,这样就能够保证不会有竞争条件的出现。
一般而言,编译器会自动保证 errno 的安全性,但是为了妥善期间,我们希望在写 makefile 的时候把 _LIBC_REENTRANT 宏定义,比如我们在检查 <bits/errno.h> 文件中发现如下的定义:C代码# ifndef __ASSEMBLER__/* Function to get address of global `errno' variable. */extern int *__errno_location (void) __THROW __attribute__ ((__const__));# if !defined _LIBC || defined _LIBC_REENTRANT/* When using threads, errno is a per-thread value. */# define errno (*__errno_location ())# endif# endif /* !__ASSEMBLER__ */#endif /* _ERRNO_H */也就是说,在没有定义 __LIBC 或者定义 _LIBC_REENTRANT 的时候, errno 是多线程 / 进程安全的。
Linux错误码大全(建议收藏)

Linux错误码大全查看错误代码errno是调试程序的一个重要方法。
当linuc C api函数发生异常时,一般会将errno变量(需include errno.h)赋一个整数值,不同的值表示不同的含义,可以通过查看该值推测出错的原因。
在实际编程中用这一招解决了不少原本看来莫名其妙的问题。
比较麻烦的是每次都要去linux源代码里面查找错误代码的含义,现在把它贴出来,以后需要查时就来这里看了。
1-34号错误号是在内核源码的include/asm-generic/errno-base.h定义35-132则是在include/asm-generic/errno.h中定义剩下还有一些更大的错误号是留给内核级别的,如系统调用等,用户程序一般是看不见的这些号的,Ubuntu9.10中/usr/src/linux-headers-2.6.31-21-generic/include/linux/errno.h#ifndef _ASM_GENERIC_ERRNO_BASE_H#define _ASM_GENERIC_ERRNO_BASE_H#define EPERM 1 /*Operation not permitted */ #define ENOENT 2 /*No such file or directory */ #define ESRCH 3 /*No such process */#define EINTR 4 /*Interrupted system call */ #define EIO 5 /*I/O error */#define ENXIO 6 /*No such device or address */ #define E2BIG 7 /*Argument list too long */ #define ENOEXEC 8 /*Exec format error */ #define EBADF 9 /*Bad file number */#define ECHILD 10 /*No child processes */ #define EAGAIN 11 /*Try again */#define ENOMEM 12 /*Out of memory */#define EACCES 13 /*Permission denied */ #define EFAULT 14 /*Bad address */#define ENOTBLK 15 /*Block device required */ #define EBUSY16 /*Device or resource busy */ #define EEXIST 17 /*File exists */#define EXDEV 18 /*Cross-device link */#define ENODEV 19 /*No such device */#define ENOTDIR 20 /*Not a directory */#define EISDIR 21 /*Is a directory */#define EINVAL 22 /*Invalid argument */#define ENFILE 23 /*File table overflow */#define EMFILE 24 /*Too many open files */#define ENOTTY 25 /*Not a typewriter */#define ETXTBSY 26 /*Text file busy */#define EFBIG 27 /*File too large */#define ENOSPC 28 /*No space left on device */ #define ESPIPE 29 /*Illegal seek */#define EROFS 30 /*Read-only file system */#define EMLINK 31 /*Too many links */#define EPIPE 32 /*Broken pipe */#define EDOM 33 /*Math argument out of domain of func */#define ERANGE 34 /*Math result not representable */#endif#include#define EDEADLK 35 /*Resource deadlock would occur */ #define ENAMETOOLONG 36 /*File name too long */#define ENOLCK 37 /*No record locks available */ #define ENOSYS 38 /*Function not implemented */ #defineENOTEMPTY 39 /*Directory not empty */#define ELOOP 40 /*Too many symbolic links encountered */#define EWOULDBLOCK EAGAIN /*Operation would block */ #define ENOMSG 42 /*No message of desired type */ #define EIDRM 43 /*Identifier removed */#define ECHRNG 44 /*Channel number out of range */ #define EL2NSYNC 45 /*Level 2 not synchronized */ #define EL3HLT 46 /*Level 3 halted */#define EL3RST 47 /*Level 3 reset */#define ELNRNG 48 /*Link number out of range */#define EUNATCH 49 /*Protocol driver not attached */ #define ENOCSI 50 /*No CSI structure available */ #define EL2HLT 51 /*Level 2 halted */#define EBADE 52 /*Invalid exchange */#define EBADR 53 /*Invalid request descriptor */ #define EXFULL 54 /*Exchange full */#define ENOANO 55 /*No anode */#define EBADRQC 56 /*Invalid request code */ #define EBADSLT 57 /*Invalid slot */#define EDEADLOCK EDEADLK#define EBFONT 59 /*Bad font file format */#define ENOSTR 60 /*Device not a stream */#define ENODATA 61 /*No data available */#define ETIME 62 /*Timer expired */#define ENOSR 63 /*Out of streams resources */#define ENONET 64 /*Machine is not on the network */ #define ENOPKG 65 /*Package not installed */ #define EREMOTE 66 /*Object is remote */#define ENOLINK 67 /*Link has been severed */ #define EADV 68 /*Advertise error */#define ESRMNT 69 /*Srmount error */#define ECOMM 70 /*Communication error on send */ #define EPROTO 71 /*Protocol error */#define EMULTIHOP 72 /*Multihop attempted */#define EDOTDOT 73 /*RFS specific error */#define EBADMSG 74 /*Not a data message */#define EOVERFLOW 75 /*Value too large for defined data type */#define ENOTUNIQ 76 /*Name not unique on network */#define EBADFD 77 /*File descriptor in bad state */ #define EREMCHG 78 /*Remote address changed */ #define ELIBACC 79 /*Can not access a needed shared library */#define ELIBBAD 80 /*Accessing a corrupted shared library */ #define ELIBSCN 81 /* .lib section in a.out corrupted */#define ELIBMAX 82 /*Attempting to link in too many shared libraries */#define ELIBEXEC 83 /*Cannot exec a shared library directly */ #define EILSEQ 84 /*Illegal byte sequence */#define ERESTART 85 /*Interrupted system call should be restarted */#define ESTRPIPE 86 /*Streams pipe error */#define EUSERS 87 /*Too many users */#define ENOTSOCK 88 /*Socket operation on non-socket */#define EDESTADDRREQ 89 /*Destination address required */ #define EMSGSIZE 90 /*Message too long */#define EPROTOTYPE 91 /*Protocol wrong type for socket */ #define ENOPROTOOPT 92 /*Protocol not available */#define EPROTONOSUPPORT 93 /*Protocol not supported */ #define ESOCKTNOSUPPORT 94 /*Socket type not supported */ #define EOPNOTSUPP 95 /*Operation not supported on transport endpoint */#define EPFNOSUPPORT 96 /*Protocol family not supported */ #define EAFNOSUPPORT 97 /*Address family not supported by protocol */#define EADDRINUSE 98 /*Address already in use */#define EADDRNOTAVAIL 99 /*Cannot assign requested address */#define ENETDOWN 100 /*Network is down */#define ENETUNREACH 101 /*Network is unreachable */#define ENETRESET 102 /*Network dropped connection because of reset */#define ECONNABORTED 103 /*Software caused connection abort */#define ECONNRESET 104 /*Connection reset by peer */#define ENOBUFS 105 /*No buffer space available */ #define EISCONN 106 /*Transport endpoint is already connected */#define ENOTCONN 107 /*Transport endpoint is not connected */#define ESHUTDOWN 108 /*Cannot send after transport endpoint shutdown */#define ETOOMANYREFS 109 /*T oo many references: cannot splice */#define ETIMEDOUT 110 /*Connection timed out */#define ECONNREFUSED 111 /*Connection refused */ #define EHOSTDOWN 112 /*Host is down */#define EHOSTUNREACH 113 /*No route to host */#define EALREADY 114 /*Operation already in progress */ #define EINPROGRESS 115 /*Operation now in progress */ #define ESTALE 116 /*Stale NFS file handle */ #define EUCLEAN 117 /*Structure needs cleaning */ #define ENOTNAM 118 /*Not a XENIX named type file */ #define ENAVAIL 119 /*No XENIX semaphores available */ #define EISNAM 120 /*Is a named type file */ #define EREMOTEIO 121 /*Remote I/O error */#define EDQUOT 122 /*Quota exceeded */#define ENOMEDIUM 123 /*No medium found */#define EMEDIUMTYPE 124 /*Wrong medium type *#define ECANCELED 125 / *操作已取消*/#define ENOKEY 126 / *必需的密钥不可用*/ #define EKEYEXPIRED 127 / *密钥已过期*/#define EKEYREVOKED 128 / *密钥已被撤销*/#define EKEYREJECTED 129 / *密钥被服务拒绝*// *用于强大的互斥体*/#define EOWNERDEAD 130 / *所有者死亡*/#define ENOTRECOVERABLE 131 / *状态不可恢复*/#define ERFKILL 132 / *由于射频杀死*/#ifdef __KERNEL__/ **用户程序切勿看到这些内容。
Linux网络编程socket错误码分析

Linux网络编程socket错误分析socket错误码:EINTR:4阻塞的操作被取消阻塞的调用打断。
如设置了发送接收超时,就会遇到这种错误。
只能针对阻塞模式的socket。
读,写阻塞的socket时,-1返回,错误号为INTR。
另外,如果出现EINTR即errno为4,错误描述Interrupted system call,操作也应该继续。
如果recv 的返回值为0,那表明连接已经断开,接收操作也应该结束。
ETIMEOUT:1101、操作超时。
一般设置了发送接收超时,遇到网络繁忙的情况,就会遇到这种错误。
2、服务器做了读数据做了超时限制,读时发生了超时。
3、错误被描述为“connect time out”,即“连接超时”,这种情况一般发生在服务器主机崩溃。
此时客户TCP 将在一定时间内(依具体实现)持续重发数据分节,试图从服务TCP 获得一个ACK 分节。
当最终放弃尝试后(此时服务器未重新启动),内核将会向客户进程返回ETIMEDOUT 错误。
如果某个中间路由器判定该服务器主机已经不可达,则一般会响应“destination unreachable”-“目的地不可达”的ICMP消息,相应的客户进程返回的错误是EHOSTUNREACH 或ENETUNREACH。
当服务器重新启动后,由于TCP 状态丢失,之前所有的连接信息也不存在了,此时对于客户端发来请求将回应RST。
如果客户进程对检测服务器主机是否崩溃很有必要,要求即使客户进程不主动发送数据也能检测出来,那么需要使用其它技术,如配置SO_KEEPALIVE Socket 选项,或实现某些心跳函数。
EAGAIN:1、Send返回值小于要发送的数据数目,会返回EAGAIN和EINTR。
2、recv 返回值小于请求的长度时说明缓冲区已经没有可读数据,但再读不一定会触发EAGAIN,有可能返回0表示TCP连接已被关闭。
3、当socket是非阻塞时,如返回此错误,表示写缓冲队列已满,可以做延时后再重试.4、在Linux进行非阻塞的socket接收数据时经常出现Resource temporarily unavailable,errno 代码为11(EAGAIN),表明在非阻塞模式下调用了阻塞操作,在该操作没有完成就返回这个错误,这个错误不会破坏socket的同步,不用管它,下次循环接着recv就可以。
Linux操作系统错误代码解释 (中英文对照)

中英文对照Linux 操作系统错误代码解释(zhouyutang@ linuxcman@)OS error code 0: Success操作系统错误代码0:成功OS error code 1: Operation not permitted操作系统错误代码1:操作不允许OS error code 2: No such file or directory操作系统错误代码2:没有这样的文件或目录OS error code 3: No such process操作系统错误代码3:没有这样的过程OS error code 4: Interrupted system call操作系统错误代码4:中断的系统调用OS error code 5: Input/output error操作系统错误代码5:输入/输出错误OS error code 6: No such device or address操作系统错误代码6:没有这样的设备或地址OS error code 7: Argument list too long操作系统错误代码7:参数列表太长OS error code 8: Exec format error操作系统错误代码8:执行格式错误OS error code 9: Bad file descriptor操作系统错误代码9:坏的文件描述符OS error code 10: No child processes操作系统错误代码10:无子过程OS error code 11: Resource temporarily unavailable 操作系统错误代码11:资源暂时不可用OS error code 12: Cannot allocate memory操作系统错误代码12:无法分配内存OS error code 13: Permission denied操作系统错误代码13:权限被拒绝OS error code 14: Bad address操作系统错误代码14:错误的地址OS error code 15: Block device required操作系统错误代码15:需要块设备OS error code 16: Device or resource busy操作系统错误代码16:设备或资源忙OS error code 17: File exists操作系统错误代码17:文件已经存在OS error code 18: Invalid cross-device link操作系统错误代码18:无效的跨设备链接OS error code 19: No such device操作系统错误代码19:没有这样的设备OS error code 20: Not a directory操作系统错误代码20:不是一个目录OS error code 21: Is a directory操作系统错误代码21:是一个目录OS error code 22: Invalid argument操作系统错误代码22:无效参数OS error code 23: Too many open files in system操作系统错误代码23:打开太多的文件系统OS error code 24: Too many open files操作系统错误代码24:打开的文件太多OS error code 25: Inappropriate ioctl for device操作系统错误代码25:不适当的设备ioctl使用OS error code 26: Text file busy操作系统错误代码26:文本文件忙OS error code 27: File too large操作系统错误代码27:文件太大OS error code 28: No space left on device操作系统错误代码28:设备上没有空间OS error code 29: Illegal seek操作系统错误代码29:非法搜索OS error code 30: Read-only file system操作系统错误代码30:只读文件系统OS error code 31: Too many links操作系统错误代码31:链接过多OS error code 32: Broken pipe操作系统错误代码32:管道破裂OS error code 33: Numerical argument out of domain 操作系统错误代码33:超出域的数值参数OS error code 34: Numerical result out of range操作系统错误代码34:数值结果超出范围OS error code 35: Resource deadlock avoided操作系统错误代码35:避免资源死锁OS error code 36: File name too long操作系统错误代码36:文件名太长OS error code 37: No locks available操作系统错误代码37:没有可用锁OS error code 38: Function not implemented操作系统错误代码38:功能没有实现OS error code 39: Directory not empty操作系统错误代码39:目录非空OS error code 40: Too many levels of symbolic links 操作系统错误代码40:符号链接层次太多OS error code 42: No message of desired type操作系统错误代码42:没有期望类型的消息OS error code 43: Identifier removed操作系统错误代码43:标识符删除OS error code 44: Channel number out of range操作系统错误代码44:通道数目超出范围OS error code 45: Level 2 not synchronized操作系统错误代码45:2级不同步OS error code 46: Level 3 halted操作系统错误代码46:3级终止OS error code 47: Level 3 reset操作系统错误代码47:3级复位OS error code 48: Link number out of range操作系统错误代码48:链接数超出范围OS error code 49: Protocol driver not attached 操作系统错误代码49:协议驱动程序没有连接OS error code 50: No CSI structure available 操作系统错误代码50:没有可用的CSI结构OS error code 51: Level 2 halted操作系统错误代码51:2级中断OS error code 52: Invalid exchange操作系统错误代码52:无效的交换OS error code 53: Invalid request descriptor 操作系统错误代码53:无效的请求描述符OS error code 54: Exchange full操作系统错误代码54:交换空间满OS error code 55: No anode操作系统错误代码55:阳极不存在OS error code 56: Invalid request code操作系统错误代码56:无效的请求代码OS error code 57: Invalid slot操作系统错误代码57:无效的槽OS error code 59: Bad font file format操作系统错误代码59:错误的字体文件格式OS error code 60: Device not a stream操作系统错误代码60:设备不属于流类型OS error code 61: No data available操作系统错误代码61:无可用数据OS error code 62: Timer expired操作系统错误代码62:超时OS error code 63: Out of streams resources操作系统错误代码63:超出流资源范围OS error code 64: Machine is not on the network 操作系统错误代码64:主机不在网络上OS error code 65: Package not installed操作系统错误代码65:软件包没有安装OS error code 66: Object is remote操作系统错误代码66:对象是远程的OS error code 67: Link has been severed操作系统错误代码67:链接被切断OS error code 68: Advertise error操作系统错误代码68:广告错误OS error code 69: Srmount error操作系统错误代码69:srmount错误OS error code 70: Communication error on send 操作系统错误代码70:发送数据时通讯错误OS error code 71: Protocol error操作系统错误代码71:协议错误OS error code 72: Multihop attempted操作系统错误代码72:企图进行多次跳转OS error code 73: RFS specific error操作系统错误代码73:RFS类型错误OS error code 74: Bad message操作系统错误代码74:坏消息OS error code 75: Value too large for defined data type操作系统错误代码75:数值超过对于给定的数据类型OS error code 76: Name not unique on network操作系统错误代码76:主机名在网络上不是唯一OS error code 77: File descriptor in bad state操作系统错误代码77:坏状态的文件描述符OS error code 78: Remote address changed操作系统错误代码78:远端地址改变OS error code 79: Can not access a needed shared library操作系统错误代码79:无法访问需要的共享库OS error code 80: Accessing a corrupted shared library操作系统错误代码80:访问了一个损坏的共享库OS error code 81: .lib section in a.out corrupted操作系统错误代码81:a. out文件中的.lib段损坏。
Linux系统编译安装常见错误处理方法

5.Configure: error: libjpeg.(a|so) not found
# yum install libjpeg libjpeg-devel
6.Configure: error: libpng.(also) not found.
# yum install libpng libpng-devel
13.Configure: error: Cannot find ldap.h
# yum install openldap-devel
本篇文章来源于 Linux公社网站() 原文链接:/Linux/2011-04/34622.htm
再php:~/:./configure …… --with-gd=/usr/local/gd2 ……
1) Configure: error: xml2-config not found. Please check your libxml2 installation.
Solutions :
Solutions :
Quote: # yum install unixODBC-devel
12) Configure: error: Cannot find pspell
Solutions :
Quote: # yum install pspell-devel
13) configure: error: mcrypt.h not found. Please reinstall libmcrypt.
7) Configure: error: freetype.h not found.
Solutions :
Quote: #yum install freetype-devel
linux系统错误码大全

linux系统错误码⼤全#define EPERM 1 /* Operation not permitted */#define ENOENT 2 /* No such file or directory */#define ESRCH 3 /* No such process */#define EINTR 4 /* Interrupted system call */#define EIO 5 /* I/O error */#define ENXIO 6 /* No such device or address */#define E2BIG 7 /* Arg list too long */#define ENOEXEC 8 /* Exec format error */#define EBADF 9 /* Bad file number */#define ECHILD 10 /* No child processes */#define EAGAIN 11 /* Try again */#define ENOMEM 12 /* Out of memory */#define EACCES 13 /* Permission denied */#define EFAULT 14 /* Bad address */#define ENOTBLK 15 /* Block device required */#define EBUSY 16 /* Device or resource busy */#define EEXIST 17 /* File exists */#define EXDEV 18 /* Cross-device link */#define ENODEV 19 /* No such device */#define ENOTDIR 20 /* Not a directory */#define EISDIR 21 /* Is a directory */#define EINVAL 22 /* Invalid argument */#define ENFILE 23 /* File table overflow */#define EMFILE 24 /* Too many open files */#define ENOTTY 25 /* Not a typewriter */#define ETXTBSY 26 /* Text file busy */#define EFBIG 27 /* File too large */#define ENOSPC 28 /* No space left on device */#define ESPIPE 29 /* Illegal seek */#define EROFS 30 /* Read-only file system */#define EMLINK 31 /* Too many links */#define EPIPE 32 /* Broken pipe */#define EDOM 33 /* Math argument out of domain of func */#define ERANGE 34 /* Math result not representable */#define EDEADLK 35 /* Resource deadlock would occur */#define ENAMETOOLONG 36 /* File name too long */#define ENOLCK 37 /* No record locks available */#define ENOSYS 38 /* Function not implemented */#define ENOTEMPTY 39 /* Directory not empty */#define ELOOP 40 /* Too many symbolic links encountered */#define EWOULDBLOCK EAGAIN /* Operation would block */#define ENOMSG 42 /* No message of desired type */#define EIDRM 43 /* Identifier removed */#define ECHRNG 44 /* Channel number out of range */#define EL2NSYNC 45 /* Level 2 not synchronized */#define EL3HLT 46 /* Level 3 halted */#define EL3RST 47 /* Level 3 reset */#define ELNRNG 48 /* Link number out of range */#define EUNATCH 49 /* Protocol driver not attached */#define ENOCSI 50 /* No CSI structure available */#define EL2HLT 51 /* Level 2 halted */#define EBADE 52 /* Invalid exchange */#define EBADR 53 /* Invalid request descriptor */#define EXFULL 54 /* Exchange full */#define ENOANO 55 /* No anode */#define EBADRQC 56 /* Invalid request code */#define EBADSLT 57 /* Invalid slot */#define EDEADLOCK EDEADLK#define EBFONT 59 /* Bad font file format */#define ENOSTR 60 /* Device not a stream */#define ENODATA 61 /* No data available */#define ETIME 62 /* Timer expired */#define ENOSR 63 /* Out of streams resources */#define ENONET 64 /* Machine is not on the network */#define ENOPKG 65 /* Package not installed */#define EREMOTE 66 /* Object is remote */#define ENOLINK 67 /* Link has been severed */#define EADV 68 /* Advertise error */#define ESRMNT 69 /* Srmount error */#define ECOMM 70 /* Communication error on send */#define EPROTO 71 /* Protocol error */#define EMULTIHOP 72 /* Multihop attempted */#define EDOTDOT 73 /* RFS specific error */#define EBADMSG 74 /* Not a data message */#define EOVERFLOW 75 /* Value too large for defined data type */#define ENOTUNIQ 76 /* Name not unique on network */#define EBADFD 77 /* File descriptor in bad state */#define EREMCHG 78 /* Remote address changed */#define ELIBACC 79 /* Can not access a needed shared library */#define ELIBBAD 80 /* Accessing a corrupted shared library */#define ELIBSCN 81 /* .lib section in a.out corrupted */#define ELIBMAX 82 /* Attempting to link in too many shared libraries */#define ELIBEXEC 83 /* Cannot exec a shared library directly */#define EILSEQ 84 /* Illegal byte sequence */#define ERESTART 85 /* Interrupted system call should be restarted */#define ESTRPIPE 86 /* Streams pipe error */#define EUSERS 87 /* Too many users */#define ENOTSOCK 88 /* Socket operation on non-socket */#define EDESTADDRREQ 89 /* Destination address required */#define EMSGSIZE 90 /* Message too long */#define EPROTOTYPE 91 /* Protocol wrong type for socket */#define ENOPROTOOPT 92 /* Protocol not available */#define EPROTONOSUPPORT 93 /* Protocol not supported */#define ESOCKTNOSUPPORT 94 /* Socket type not supported */#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ #define EPFNOSUPPORT 96 /* Protocol family not supported */#define EAFNOSUPPORT 97 /* Address family not supported by protocol */#define EADDRINUSE 98 /* Address already in use */#define EADDRNOTAVAIL 99 /* Cannot assign requested address */#define ENETDOWN 100 /* Network is down */#define ENETUNREACH 101 /* Network is unreachable */#define ENETRESET 102 /* Network dropped connection because of reset */ #define ECONNABORTED 103 /* Software caused connection abort */#define ECONNRESET 104 /* Connection reset by peer */#define ENOBUFS 105 /* No buffer space available */#define EISCONN 106 /* Transport endpoint is already connected */#define ENOTCONN 107 /* Transport endpoint is not connected */#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ #define ETOOMANYREFS 109 /* Too many references: cannot splice */#define ETIMEDOUT 110 /* Connection timed out */#define ECONNREFUSED 111 /* Connection refused */#define EHOSTDOWN 112 /* Host is down */#define EHOSTUNREACH 113 /* No route to host */#define EALREADY 114 /* Operation already in progress */#define EINPROGRESS 115 /* Operation now in progress */#define ESTALE 116 /* Stale NFS file handle */#define EUCLEAN 117 /* Structure needs cleaning */#define ENOTNAM 118 /* Not a XENIX named type file */#define ENAVAIL 119 /* No XENIX semaphores available */#define EISNAM 120 /* Is a named type file */#define EREMOTEIO 121 /* Remote I/O error */#define EDQUOT 122 /* Quota exceeded */#define ENOMEDIUM 123 /* No medium found */#define EMEDIUMTYPE 124 /* Wrong medium type */。
linux 高压力 connection reset by peer 系统参数 -回复

linux 高压力connection reset by peer 系统参数-回复Linux系统中出现"connection reset by peer"的错误提示是指在网络传输过程中,被对端主动关闭连接或发生了连接异常导致连接被重置。
这种错误常见于高压力连接场景下,可能是由于资源不足、网络延迟、负载过重等原因导致的。
为了解决这个问题,可以通过调整系统参数来优化网络连接,保证系统的稳定性和可靠性。
第一步:了解"connection reset by peer"错误的原因和特征(150-300字)"connection reset by peer"错误提示意味着在网络传输过程中遇到了连接异常。
这种错误通常由于对端关闭连接、网络延迟、资源不足或负载过重等原因引起。
在高压力连接场景下,如并发请求较多或数据传输较大的情况下,可能会出现这个错误。
它会导致连接异常中断,影响数据传输的完整性和稳定性。
第二步:确定系统版本和调整系统参数的方法(200-400字)首先,确定你使用的是哪个Linux系统版本,因为不同版本的系统对应的参数设置方法可能会有所不同。
可通过以下命令查看:cat /etc/issueuname -a根据系统版本的不同,可以参考相应的文档或在线资源来了解如何调整系统参数。
通常,系统参数可以通过修改配置文件或使用sysctl命令来进行设置。
第三步:调整网络连接参数以优化系统性能(400-700字)1. 调整TCP连接参数TCP连接参数可以控制连接的创建、维持和关闭等行为。
其中一些关键的参数包括:- tcp_fin_timeout: 该参数定义了连接关闭后等待关闭操作完成的时间,默认值为60秒。
可以根据实际情况适当缩短这个时间,如设置为30秒,以减少连接的持续时间。
- tcp_syn_retries: 该参数定义了在连接建立过程中重试的次数,默认值为5次。
Kernel panic常见原因

kernel panic错误表现kernel panic 主要有以下几个出错提示:Kernel panic-not syncing fatal exception in interruptkernel panic - not syncing: Attempted to kill the idle task!kernel panic - not syncing: killing interrupt handler!Kernel Panic - not syncing:Attempted to kill init !kernel错误分析查看了一下 linux的源码文件,找到相关位置kernel/panic.cNORET_TYPE void panic(const char * fmt, ...){static char buf[1024];va_list args;bust_spinlocks(1);va_start(args, fmt);vsnprintf(buf, sizeof(buf), fmt, args);va_end(args);printk(KERN_EMERG "Kernel panic - not syncing: %s/n",buf);bust_spinlocks(0);kernel/exit.cif (unlikely(in_interrupt()))panic("Aiee, killing interrupt handler!"); #中断处理if (unlikely(!tsk->pid))panic("Attempted to kill the idle task!"); #空任务if (unlikely(tsk->pid == 1))panic("Attempted to kill init!"); #初始化从其他源文件和相关文档看到应该有几种原因:1、硬件问题使用了 SCSI-device 并且使用了未知命令#WDIOS_TEMPPANIC Kernel panic on temperature trip## The SETOPTIONS call can be used to enable and disable the card# and to ask the driver to call panic if the system overheats.## If one uses a SCSI-device of unsupported type/commands, one# immediately runs into a kernel-panic caused by Command Error. To better # understand which SCSI-command caused the problem, I extended this# specific panic-message slightly.##read/write causes a command error from# the subsystem and this causes kernel-panic2、系统过热如果系统过热会调用panci,系统挂起#WDIOS_TEMPPANIC Kernel panic on temperature trip## The SETOPTIONS call can be used to enable and disable the card# and to ask the driver to call panic if the system overheats.3、文件系统引起#A variety of panics and hangs with /tmp on a reiserfs filesystem#Any other panic, hang, or strange behavior## It turns out that there's a limit of six environment variables on the# kernel command line. When that limit is reached or exceeded, argument # processing stops, which means that the 'root=' argument that UML# usually adds is not seen. So, the filesystem has no idea what the# root device is, so it panics.# The fix is to put less stuff on the command line. Glomming all your# setup variables into one is probably the best way to go.Linux内核命令行有6个环境变量。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
常见的Linux系统错误码,即errorno的值1 EPERM Operation not permitted 操作不许可2 ENOENT No such file or directory 无此文件或目录3 ESRCH No such process 无此过程4 EINTR Interrupted system call 系统调用被禁止5 EIO I/O error I/O 错误6 ENXIO No such device or address 无此器件或地址7 E2BIG Arg list too long Arg 列表太长8 ENOEXEC Exec format error Exec 格式错误9 EBADF Bad file number 文件数目错误10 ECHILD No child processes 无子过程11 EAGAIN Try again 再试一遍12 ENOMEM Out of memory 内存溢出13 EACCES Permission denied 许可拒绝14 EFAULT Bad address 错误的地址15 ENOTBLK Block device required 需要块设备16 EBUSY Device or resource busy 设备或资源忙17 EEXIST File exists 文件存在18 EXDEV Cross-device link 跨器链接19 ENODEV No such device 无此设备20 ENOTDIR Not a directory 不是一个目录21 EISDIR Is a directory 是一个目录22 EINV AL Invalid argument 无效的函数自变量23 ENFILE File table overflow 文件表溢出24 EMFILE Too many open files 打开的文件太多25 ENOTTY Inappropriate ioctl for device26 ETXTBSY Text file busy 文本文件忙27 EFBIG File too large 文件太大28 ENOSPC No space left on device 磁盘空间不足29 ESPIPE Illegal seek 不合法的寻找30 EROFS Read-only file system 只读文件系统31 EMLINK Too many links 太多的链接/usr/include/asm-generic/errno-base.h#define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */#define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */#define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Argument list too long */#define ENOEXEC 8 /* Exec format error */#define EBADF 9 /* Bad file number */#define ECHILD 10 /* No child processes */#define EAGAIN 11 /* Try again */#define ENOMEM 12 /* Out of memory */#define EACCES 13 /* Permission denied */#define EFAULT 14 /* Bad address */#define ENOTBLK 15 /* Block device required */#define EBUSY 16 /* Device or resource busy */ #define EEXIST 17 /* File exists */#define EXDEV 18 /* Cross-device link */#define ENODEV 19 /* No such device */#define ENOTDIR 20 /* Not a directory */#define EISDIR 21 /* Is a directory */#define EINVAL 22 /* Invalid argument */#define ENFILE 23 /* File table overflow */#define EMFILE 24 /* Too many open files */#define ENOTTY 25 /* Not a typewriter */#define ETXTBSY 26 /* Text file busy */#define EFBIG 27 /* File too large */#define ENOSPC 28 /* No space left on device */#define ESPIPE 29 /* Illegal seek */#define EROFS 30 /* Read-only file system */#define EMLINK 31 /* Too many links */#define EPIPE 32 /* Broken pipe */#define EDOM 33 /* Math argument out of domain of func */ #define ERANGE 34 /* Math result not representable *//usr/include/asm-generic/errno.h#define EDEADLK 35 /* Resource deadlock would occur */#define ENAMETOOLONG 36 /* File name too long */#define ENOLCK 37 /* No record locks available */#define ENOSYS 38 /* Function not implemented */#define ENOTEMPTY 39 /* Directory not empty */#define ELOOP 40 /* Too many symbolic links encountered */ #define EWOULDBLOCK EAGAIN /* Operation would block */#define ENOMSG 42 /* No message of desired type */#define EIDRM 43 /* Identifier removed */#define ECHRNG 44 /* Channel number out of range */#define EL2NSYNC 45 /* Level 2 not synchronized */#define EL3HLT 46 /* Level 3 halted */#define EL3RST 47 /* Level 3 reset */#define ELNRNG 48 /* Link number out of range */#define EUNATCH 49 /* Protocol driver not attached */ #define ENOCSI 50 /* No CSI structure available */#define EL2HLT 51 /* Level 2 halted */#define EBADE 52 /* Invalid exchange */#define EBADR 53 /* Invalid request descriptor */#define EXFULL 54 /* Exchange full */#define ENOANO 55 /* No anode */#define EBADRQC 56 /* Invalid request code */#define EBADSLT 57 /* Invalid slot */#define EDEADLOCK EDEADLK#define EBFONT 59 /* Bad font file format */#define ENOSTR 60 /* Device not a stream */#define ENODATA 61 /* No data available */#define ETIME 62 /* Timer expired */#define ENOSR 63 /* Out of streams resources */#define ENONET 64 /* Machine is not on the network */ #define ENOPKG 65 /* Package not installed */#define EREMOTE 66 /* Object is remote */#define ENOLINK 67 /* Link has been severed */#define EADV 68 /* Advertise error */#define ESRMNT 69 /* Srmount error */#define ECOMM 70 /* Communication error on send */#define EPROTO 71 /* Protocol error */#define EMULTIHOP 72 /* Multihop attempted */#define EDOTDOT 73 /* RFS specific error */#define EBADMSG 74 /* Not a data message */#define EOVERFLOW 75 /* Value too large for defined data type */#define ENOTUNIQ 76 /* Name not unique on network */#define EBADFD 77 /* File descriptor in bad state */#define EREMCHG 78 /* Remote address changed */#define ELIBACC 79 /* Can not access a needed shared library */#define ELIBBAD 80 /* Accessing a corrupted shared library */#define ELIBSCN 81 /* .lib section in a.out corrupted */#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ #define ELIBEXEC 83 /* Cannot exec a shared library directly */#define EILSEQ 84 /* Illegal byte sequence */#define ERESTART 85 /* Interrupted system call should be restarted */#define ESTRPIPE 86 /* Streams pipe error */#define EUSERS 87 /* Too many users */#define ENOTSOCK 88 /* Socket operation on non-socket */#define EDESTADDRREQ 89 /* Destination address required */#define EMSGSIZE 90 /* Message too long */#define EPROTOTYPE 91 /* Protocol wrong type for socket */#define ENOPROTOOPT 92 /* Protocol not available */#define EPROTONOSUPPORT 93 /* Protocol not supported */#define ESOCKTNOSUPPORT 94 /* Socket type not supported */#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */#define EPFNOSUPPORT 96 /* Protocol family not supported */#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ #define EADDRINUSE 98 /* Address already in use */#define EADDRNOTAVAIL 99 /* Cannot assign requested address */#define ENETDOWN 100 /* Network is down */#define ENETUNREACH 101 /* Network is unreachable */#define ENETRESET 102 /* Network dropped connection because of reset */#define ECONNABORTED 103 /* Software caused connection abort */#define ECONNRESET 104 /* Connection reset by peer */#define ENOBUFS 105 /* No buffer space available */#define EISCONN 106 /* Transport endpoint is already connected */#define ENOTCONN 107 /* Transport endpoint is not connected */#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */#define ETOOMANYREFS 109 /* Too many references: cannot splice */#define ETIMEDOUT 110 /* Connection timed out */#define ECONNREFUSED 111 /* Connection refused */#define EHOSTDOWN 112 /* Host is down */#define EHOSTUNREACH 113 /* No route to host */#define EALREADY 114 /* Operation already in progress */ #define EINPROGRESS 115 /* Operation now in progress */ #define ESTALE 116 /* Stale NFS file handle */#define EUCLEAN 117 /* Structure needs cleaning */#define ENOTNAM 118 /* Not a XENIX named type file */ #define ENAVAIL 119 /* No XENIX semaphores available */ #define EISNAM 120 /* Is a named type file */#define EREMOTEIO 121 /* Remote I/O error */#define EDQUOT 122 /* Quota exceeded */#define ENOMEDIUM 123 /* No medium found */#define EMEDIUMTYPE 124 /* Wrong medium type */#define ECANCELED 125 /* Operation Canceled */#define ENOKEY 126 /* Required key not available */#define EKEYEXPIRED 127 /* Key has expired */#define EKEYREVOKED 128 /* Key has been revoked */#define EKEYREJECTED 129 /* Key was rejected by service */ /* for robust mutexes */#define EOWNERDEAD 130 /* Owner died */#define ENOTRECOVERABLE 131 /* State not recoverable */。