linux error code
LINUX操作系统错误代码解释 (中英文对照)
中英文对照Linux操作系统错误代码解释(zhouyutang@ linuxcman@)OS error code0:Success操作系统错误代码0:成功OS error code1:Operation not permitted操作系统错误代码1:操作不允许OS error code2:No such file or directory操作系统错误代码2:没有这样的文件或目录OS error code3:No such process操作系统错误代码3:没有这样的过程OS error code4:Interrupted system call操作系统错误代码4:中断的系统调用OS error code5:Input/output error操作系统错误代码5:输入/输出错误OS error code6:No such device or address操作系统错误代码6:没有这样的设备或地址OS error code7:Argument list too long操作系统错误代码7:参数列表太长OS error code8:Exec format error操作系统错误代码8:执行格式错误OS error code9:Bad file descriptor操作系统错误代码9:坏的文件描述符OS error code10:No child processes操作系统错误代码10:无子过程OS error code11:Resource temporarily unavailable 操作系统错误代码11:资源暂时不可用OS error code12:Cannot allocate memory操作系统错误代码12:无法分配内存OS error code13:Permission denied操作系统错误代码13:权限被拒绝OS error code14:Bad address操作系统错误代码14:错误的地址OS error code15:Block device required操作系统错误代码15:需要块设备OS error code16:Device or resource busy操作系统错误代码16:设备或资源忙OS error code17:File exists操作系统错误代码17:文件已经存在OS error code18:Invalid cross-device link操作系统错误代码18:无效的跨设备链接OS error code19:No such device操作系统错误代码19:没有这样的设备OS error code20:Not a directory操作系统错误代码20:不是一个目录OS error code21:Is a directory操作系统错误代码21:是一个目录OS error code22:Invalid argument操作系统错误代码22:无效参数OS error code23:Too many open files in system操作系统错误代码23:打开太多的文件系统OS error code24:Too many open files操作系统错误代码24:打开的文件太多OS error code25:Inappropriate ioctl for device操作系统错误代码25:不适当的设备ioctl使用OS error code26:Text file busy操作系统错误代码26:文本文件忙OS error code27:File too large操作系统错误代码27:文件太大OS error code28:No space left on device操作系统错误代码28:设备上没有空间OS error code29:Illegal seek操作系统错误代码29:非法搜索OS error code30:Read-only file system操作系统错误代码30:只读文件系统OS error code31:Too many links操作系统错误代码31:链接过多OS error code32:Broken pipe操作系统错误代码32:管道破裂OS error code33:Numerical argument out of domain 操作系统错误代码33:超出域的数值参数OS error code34:Numerical result out of range操作系统错误代码34:数值结果超出范围OS error code35:Resource deadlock avoided操作系统错误代码35:避免资源死锁OS error code36:File name too long操作系统错误代码36:文件名太长OS error code37:No locks available操作系统错误代码37:没有可用锁OS error code38:Function not implemented操作系统错误代码38:功能没有实现OS error code39:Directory not empty操作系统错误代码39:目录非空OS error code40:Too many levels of symbolic links 操作系统错误代码40:符号链接层次太多OS error code42:No message of desired type操作系统错误代码42:没有期望类型的消息OS error code43:Identifier removed操作系统错误代码43:标识符删除OS error code44:Channel number out of range操作系统错误代码44:通道数目超出范围OS error code45:Level2not synchronized操作系统错误代码45:2级不同步OS error code46:Level3halted操作系统错误代码46:3级终止OS error code47:Level3reset操作系统错误代码47:3级复位OS error code48:Link number out of range操作系统错误代码48:链接数超出范围OS error code49:Protocol driver not attached 操作系统错误代码49:协议驱动程序没有连接OS error code50:No CSI structure available 操作系统错误代码50:没有可用的CSI结构OS error code51:Level2halted操作系统错误代码51:2级中断OS error code52:Invalid exchange操作系统错误代码52:无效的交换OS error code53:Invalid request descriptor 操作系统错误代码53:无效的请求描述符OS error code54:Exchange full操作系统错误代码54:交换空间满OS error code55:No anode操作系统错误代码55:阳极不存在OS error code56:Invalid request code操作系统错误代码56:无效的请求代码OS error code57:Invalid slot操作系统错误代码57:无效的槽OS error code59:Bad font file format操作系统错误代码59:错误的字体文件格式OS error code60:Device not a stream操作系统错误代码60:设备不属于流类型OS error code61:No data available操作系统错误代码61:无可用数据OS error code62:Timer expired操作系统错误代码62:超时OS error code63:Out of streams resources操作系统错误代码63:超出流资源范围OS error code64:Machine is not on the network 操作系统错误代码64:主机不在网络上OS error code65:Package not installed操作系统错误代码65:软件包没有安装OS error code66:Object is remote操作系统错误代码66:对象是远程的OS error code67:Link has been severed操作系统错误代码67:链接被切断OS error code68:Advertise error操作系统错误代码68:广告错误OS error code69:Srmount error操作系统错误代码69:srmount错误OS error code70:Communication error on send 操作系统错误代码70:发送数据时通讯错误OS error code71:Protocol error操作系统错误代码71:协议错误OS error code72:Multihop attempted操作系统错误代码72:企图进行多次跳转OS error code73:RFS specific error操作系统错误代码73:RFS类型错误OS error code74:Bad message操作系统错误代码74:坏消息OS error code75:Value too large for defined data type操作系统错误代码75:数值超过对于给定的数据类型OS error code76:Name not unique on network操作系统错误代码76:主机名在网络上不是唯一OS error code77:File descriptor in bad state操作系统错误代码77:坏状态的文件描述符OS error code78:Remote address changed操作系统错误代码78:远端地址改变OS error code79:Can not access a needed shared library操作系统错误代码79:无法访问需要的共享库OS error code80:Accessing a corrupted shared library操作系统错误代码80:访问了一个损坏的共享库OS error code81:.lib section in a.out corrupted操作系统错误代码81:a.out文件中的.lib段损坏。
linux pssh exited with error code -回复
linux pssh exited with error code -回复Linux PSSH is a powerful command-line tool that allows users to remotely manage multiple systems simultaneously. However, there are instances where PSSH may exit with an error code, preventing users from achieving their intended tasks. In this article, we will delve into some common situations that can cause PSSH to exit with an error code and discuss potential solutions to overcome them.1. Understanding the Error CodeWhen PSSH exits with an error code, it signifies that an error has occurred during the execution of the command. The error code provides valuable information about the type of error encountered, helping users identify the problem and find a suitable solution.2. Common Causes of PSSH Exit Errorsa. Authentication Failure: One of the most common causes of PSSH exit errors is an authentication failure. If the remote systems require SSH keys or passwords for authentication, any mismatch or incorrect input can result in an authentication failure and cause PSSH to exit with an error code. Ensure that the authentication credentials are correctly specified and accessible.b. Connection Issues: PSSH relies on stable and reliable network connections to establish communication with remote systems. Inadequate or interrupted network connectivity can cause PSSH to exit with an error code. Check the network settings, firewall configuration, and the status of the remote systems to identify and address any connection issues.c. Command Syntax Errors: Incorrect command syntax or improper usage of PSSH commands can lead to exit errors. Review the command syntax carefully, ensure that the commands are appropriately formatted, and consider consulting the PSSH documentation for correct usage.d. Insufficient Privileges: PSSH requires sufficient privileges to execute certain commands or access specific files. If the user executing PSSH does not have the necessary privileges, it can result in exit errors. Ensure that the user has the required permissions to perform the desired tasks and modify the user privileges accordingly.e. Resource Constraints: PSSH may exit with an error code if theremote systems are running low on system resources such as memory or disk space. Insufficient resources can hinder the execution of commands, causing PSSH to terminate with an error. Verify the resource utilization on the remote systems and take appropriate action to alleviate any resource constraints.3. Troubleshooting PSSH Exit Errorsa. Check Error Codes: When PSSH exits with an error code, review the numeric value of the error to gain insights into the specific issue encountered. Error codes are commonly documented in PSSH's official documentation or forums. Understanding the error code can narrow down the troubleshooting process and guide you towards a solution.b. Verify Authentication Credentials: Double-check the authenticity credentials provided to PSSH. Ensure that SSH keys are correctly configured, passwords are entered correctly, and the necessary credentials are accessible and valid. Fix any mismatches or incorrect inputs to resolve authentication failures.c. Test Network Connectivity: Evaluate network connectivity between the local and remote systems. Verify that there are nofirewalls, proxies, or network restrictions preventing proper communication. Conduct network tests, such as pinging the remote system or using SSH directly, to identify any network issues.d. Review Command Syntax: Thoroughly review the command syntax used with PSSH. Pay special attention to the order of options, use of quotation marks, and any special characters required. Utilize PSSH's documentation or consult online resources to ensure correct command usage.e. Confirm User Privileges: Determine if the user executing PSSH has the necessary permissions to perform the desired tasks. Check the user's permissions, group memberships, and any restricted access policies that might affect PSSH's execution. Elevate user privileges if necessary.f. Monitor System Resources: Keep an eye on the resource utilization of both the local and remote systems where PSSH is being used. Ensure sufficient memory, disk space, and CPU availability to avoid resource-related exit errors. Free up resources, if needed, by terminating unnecessary processes or expanding resource capacity.4. ConclusionLinux PSSH is a versatile tool for managing remote systems efficiently. However, it is not immune to occasional errors leading to premature exits. By identifying common causes such as authentication failures, connection issues, command syntax errors, insufficient privileges, and resource constraints, users can effectively troubleshoot and resolve PSSH exit errors. Remember to consult official documentation and utilize online resources for specific error code meanings and additional troubleshooting techniques. With the insights provided in this article, users can overcome hurdles and maximize the potential of PSSH for seamless remote system management.。
linux 上几条命令的exit code
在Linux 上,命令的退出码(exit code)是一个整数,用于表示命令执行的结果。
通常情况下,退出码为0 表示命令执行成功,非零值表示出现错误。
以下是一些常见的退出码及其含义:
- 0:表示命令执行成功
- 1:表示命令执行失败
- 2:表示命令执行过程中出现错误
- 126:表示命令无法找到
- 127:表示命令未找到
- 其他数字:表示命令执行过程中出现的错误代码
这些退出码可以在命令执行后通过`$?` 变量获取。
例如:
```bash
ls /nonexistent_directory
echo $?
```
在这个例子中,`ls` 命令尝试列出一个不存在的目录,因此返回非零退出码2。
通过`echo $?` 可以输出这个退出码。
Linux系统错误码对照表
Linux系统错误码对照表C Name Value DescriptionEPERM1Operation not permittedENOENT2No such file or directoryESRCH3No such processEINTR4Interrupted system callEIO5I/O errorENXIO6No such device or addressE2BIG7Arg list too longENOEXEC8Exec format errorEBADF9Bad file numberECHILD10No child processesEAGAIN11Try againENOMEM12Out of memoryEACCES13Permission deniedEFAULT14Bad addressENOTBLK15Block device requiredEBUSY16Device or resource busyEEXIST17File existsEXDEV18Cross-device linkENODEV19No such deviceENOTDIR20Not a directoryEISDIR21Is a directoryEINVAL22Invalid argumentENFILE23File table overflowEMFILE24Too many open filesENOTTY25Not a tty deviceETXTBSY26Text file busyEFBIG27File too largeENOSPC28No space left on deviceESPIPE29Illegal seekEROFS30Read-only file systemEMLINK31Too many linksEPIPE32Broken pipeEDOM33Math argument out of domainERANGE34Math result not representableEDEADLK35Resource deadlock would occurENAMETOOLONG36Filename too longENOLCK37No record locks availableENOSYS38Function not implementedENOTEMPTY39Directory not emptyELOOP40Too many symbolic links encounteredEWOULDBLOCK41Same as EAGAINENOMSG42No message of desired typeEIDRM43Identifier removedECHRNG44Channel number out of rangeEL2NSYNC45Level 2 not synchronizedEL3HLT46Level 3 haltedEL3RST47Level 3 resetELNRNG48Link number out of rangeEUNATCH49Protocol driver not attachedENOCSI50No CSI structure availableEL2HLT51Level 2 haltedEBADE52Invalid exchangeEBADR53Invalid request descriptorEXFULL54Exchange fullEXFULL54Exchange fullENOANO55No anodeEBADRQC56Invalid request codeEBADSLT57Invalid slotEDEADLOCK -Same as EDEADLKEBFONT59Bad font file formatENOSTR60Device not a streamENODATA61No data availableETIME62Timer expiredENOSR63Out of streams resourcesENONET64Machine is not on the network ENOPKG65Package not installedEREMOTE66Object is remoteENOLINK67Link has been severedEADV68Advertise errorESRMNT69Srmount errorECOMM70Communication error on send EPROTO71Protocol errorEMULTIHOP72Multihop attemptedEDOTDOT73RFS specific errorEBADMSG74Not a data messageEOVERFLOW75Value too large for defined data type ENOTUNIQ76Name not unique on networkEBADFD77File descriptor in bad state EREMCHG78Remote address changedELIBACC79Cannot access a needed shared library ELIBBAD80Accessing a corrupted shared library ELIBSCN81 A .lib section in an .out is corrupted ELIBMAX82Linking in too many shared libraries ELIBEXEC83Cannot exec a shared library directly EILSEQ84Illegal byte sequenceERESTART85Interrupted system call should be restarted ESTRPIPE86Streams pipe errorEUSERS87Too many usersENOTSOCK88Socket operation on non-socket EDESTADDRREQ89Destination address required EMSGSIZE90Message too longEPROTOTYPE91Protocol wrong type for socket ENOPROTOOPT92Protocol not available EPROTONOSUPPORT93Protocol not supported ESOCKTNOSUPPORT94Socket type not supported EOPNOTSUPP95Operation not supported on transport EPFNOSUPPORT96Protocol family not supported EAFNOSUPPORT97Address family not supported by protocol EADDRINUSE98Address already in use EADDRNOTAVAIL99Cannot assign requested address ENETDOWN100Network is downENETUNREACH101Network is unreachableENETRESET102Network dropped ECONNABORTED103Software caused connection ECONNRESET104Connection reset byENOBUFS105No buffer space availableEISCONN106Transport endpointENOTCONN107Transport endpointESHUTDOWN108Cannot send after transport ETOOMANYREFS109Too many referencesETIMEDOUT110Connection timed ECONNREFUSED111Connection refusedECONNREFUSED111Connection refused EHOSTDOWN112Host is down EHOSTUNREACH113No route to host EALREADY114Operation already EINPROGRESS115Operation now in ESTALE116Stale NFS file handle EUCLEAN117Structure needs cleaning ENOTNAM118Not a XENIX-named ENAVAIL119No XENIX semaphores EISNAM120Is a named type file EREMOTEIO121Remote I/O error EDQUOT122Quota exceeded ENOMEDIUM123No medium found EMEDIUMTYPE124Wrong medium type。
linux errno 处理方法 -回复
linux errno 处理方法-回复"Linux errno Error Handling Methods: A Step-by-Step Guide"Introduction:In Linux, error numbers (errno) are used to indicate various types of errors that can occur during system calls or library function calls. These error codes provide valuable information about the cause and nature of the error, aiding developers in troubleshooting and handling errors effectively. In this article, we will delve into errno handling methods in Linux, providing a step-by-step guide to address them proficiently.Step 1: Understanding errnoErrno is a globally accessible integer variable that is set by system calls or library functions when an error occurs. It is declared in the header file "errno.h" and is initialized to zero at program startup. When an error occurs, the system calls or library functions set the appropriate error code in errno, and the error code remains valid until it is explicitly changed by a successful function call or until the program exits.Step 2: Retrieving Error InformationTo retrieve error information, we need to include the "errno.h" header file and access the value of errno using the global variable. The value of errno can be different for each error and typically ranges from 1 to 255. Additionally, the "string.h" header file provides the strerror() function, which converts errno to a human-readable string representing the error message.Step 3: Analyzing Common Errno ErrorsLinux provides a comprehensive set of error codes for various types of errors. Some commonly encountered errno errors include:- EACCES (13): Permission denied –Indicates unauthorized access to a file or directory. To handle this error, ensure the correct permissions are set and authenticate the user if necessary.- EFAULT (14): Bad address –Occurs when an invalid or inaccessible memory address is accessed. This error can be handled by checking for invalid pointer dereferences and validating memory addresses.- EINVAL (22): Invalid argument –Indicates that an argument passed to a function is unexpected or invalid. To resolve this error, ensure the correct data types and values are passed as arguments to the function.- ENOENT (2): No such file or directory –Occurs when a file or directory being accessed does not exist. To handle this error, verify the existence and correct path of the file or directory being referenced.- EIO (5): Input/output error –Represents an input or output operation failure. This error requires thorough investigation, including checking for faulty hardware, file system corruption, or incorrect device configurations.Step 4: Proper Error Handling TechniquesWhen encountering errno errors, it is crucial to handle them properly to avoid program crashes and ensure graceful recovery. Some best practices for error handling include:- Check and Report Errors: Always check the return value of system calls or functions for failure and evaluate the errno value. If an error occurs, analyze the errno value and report or log appropriate error messages for debugging purposes.- Graceful Error Recovery: Depending on the nature of the error, implement appropriate recovery mechanisms. This may involve attempting the operation again, providing alternate solutions, or terminating the program gracefully while ensuring any activeresources are properly released.- Error Propagation: In cases where functions call other functions, it is essential to propagate errors to the calling functions instead of silently ignoring or mishandling them. This allows for proper error handling at higher levels of the program.- Use EINTR Handling: Certain system calls can be interrupted by signals, resulting in errno being set to EINTR. This can be managed by implementing a retry mechanism to ensure the interrupted system call completes successfully.Step 5: Advanced Error Handling TechniquesIn addition to the basic error handling techniques mentioned above, Linux provides several advanced features to enhance error handling:- errno Thread Safety: By default, errno is a global variable accessible to all threads. However, Linux provides a per-thread variant called "__errno_location()" to ensure thread safety. This function returns a pointer to the thread-specific errno variable to avoid potential race conditions.- Error Queues: In some cases, multiple errors may occur before a program handles each one. Linux provides the feature ofmaintaining a queue of errors using "errno" and "perror" functions, allowing developers to address multiple errors systematically.- Error Logging: To aid in debugging and troubleshooting, logging error messages and associated information is essential. Linux offers various logging mechanisms, such as syslog, which allows errors to be recorded with timestamp information, severity levels, and other relevant details.Conclusion:Understanding and effectively handling errno errors is vital for developing robust and reliable Linux applications. By following the step-by-step guide provided in this article, developers can proficiently address errno errors, check for potential pitfalls, and implement appropriate error handling techniques. By doing so, developers can enhance the stability and reliability of theirLinux-based software systems.。
常见的Linux系统错误码
常见的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 */。
linux errno 处理方法
linux errno 处理方法"Linux errno Error Handling Methods: A Step-by-Step Guide"Introduction:In Linux, error numbers (errno) are used to indicate various types of errors that can occur during system calls or library function calls. These error codes provide valuable information about the cause and nature of the error, aiding developers in troubleshooting and handling errors effectively. In this article, we will delve into errno handling methods in Linux, providing a step-by-step guide to address them proficiently.Step 1: Understanding errnoErrno is a globally accessible integer variable that is set by system calls or library functions when an error occurs. It is declared in the header file "errno.h" and is initialized to zero at program startup. When an error occurs, the system calls or library functions set the appropriate error code in errno, and the error code remains valid until it is explicitly changed by a successful function call or until the program exits.Step 2: Retrieving Error InformationTo retrieve error information, we need to include the "errno.h" header file and access the value of errno using the global variable. The value of errno can be different for each error and typically ranges from 1 to 255. Additionally, the "string.h" header file provides the strerror() function, which converts errno to a human-readable string representing the error message.Step 3: Analyzing Common Errno ErrorsLinux provides a comprehensive set of error codes for various types of errors. Some commonly encountered errno errors include:- EACCES (13): Permission denied –Indicates unauthorized access to a file or directory. To handle this error, ensure the correct permissions are set and authenticate the user if necessary.- EFAULT (14): Bad address –Occurs when an invalid or inaccessible memory address is accessed. This error can be handled by checking for invalid pointer dereferences and validating memory addresses.- EINVAL (22): Invalid argument –Indicates that an argument passed to a function is unexpected or invalid. To resolve this error, ensure the correct data types and values are passed as arguments to the function.- ENOENT (2): No such file or directory –Occurs when a file or directory being accessed does not exist. To handle this error, verify the existence and correct path of the file or directory being referenced.- EIO (5): Input/output error –Represents an input or output operation failure. This error requires thorough investigation, including checking for faulty hardware, file system corruption, or incorrect device configurations.Step 4: Proper Error Handling TechniquesWhen encountering errno errors, it is crucial to handle them properly to avoid program crashes and ensure graceful recovery. Some best practices for error handling include:- Check and Report Errors: Always check the return value of system calls or functions for failure and evaluate the errno value. If an error occurs, analyze the errno value and report or log appropriate error messages for debugging purposes.- Graceful Error Recovery: Depending on the nature of the error, implement appropriate recovery mechanisms. This may involve attempting the operation again, providing alternate solutions, or terminating the program gracefully while ensuring any activeresources are properly released.- Error Propagation: In cases where functions call other functions, it is essential to propagate errors to the calling functions instead of silently ignoring or mishandling them. This allows for proper error handling at higher levels of the program.- Use EINTR Handling: Certain system calls can be interrupted by signals, resulting in errno being set to EINTR. This can be managed by implementing a retry mechanism to ensure the interrupted system call completes successfully.Step 5: Advanced Error Handling TechniquesIn addition to the basic error handling techniques mentioned above, Linux provides several advanced features to enhance error handling:- errno Thread Safety: By default, errno is a global variable accessible to all threads. However, Linux provides a per-thread variant called "__errno_location()" to ensure thread safety. This function returns a pointer to the thread-specific errno variable to avoid potential race conditions.- Error Queues: In some cases, multiple errors may occur before a program handles each one. Linux provides the feature ofmaintaining a queue of errors using "errno" and "perror" functions, allowing developers to address multiple errors systematically.- Error Logging: To aid in debugging and troubleshooting, logging error messages and associated information is essential. Linux offers various logging mechanisms, such as syslog, which allows errors to be recorded with timestamp information, severity levels, and other relevant details.Conclusion:Understanding and effectively handling errno errors is vital for developing robust and reliable Linux applications. By following the step-by-step guide provided in this article, developers can proficiently address errno errors, check for potential pitfalls, and implement appropriate error handling techniques. By doing so, developers can enhance the stability and reliability of theirLinux-based software systems.。
Linux错误码大全(建议收藏)
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 EFAULT14 /*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 */ #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 notsupported */ #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 writeback error on inode
linux writeback error on inode
Linuxwritebackerroroninode,指的是在Linux文件系统中,在写入数据时,出现了对特定inode的写入错误。
这种错误可能会导致数据丢失或破坏,因此需要及时处理。
在Linux文件系统中,每个文件或目录都有一个唯一的inode号码。
当用户对文件进行修改时,文件系统会将这些修改数据存储在缓冲区中,然后将其同步到硬盘上对应的inode中。
这个过程称为写回(writeback)。
如果在写回过程中发生错误,可能会导致数据丢失或损坏。
这些错误可能是由于硬件故障、操作系统错误或其他因素引起的。
为了解决这些问题,Linux文件系统提供了一些工具来检测和修复inode错误。
例如,fsck工具可以检查文件系统并尝试修复损坏的inode。
另外,可以使用backup和restore工具来备份和恢复文件系统。
如果这些工具不能解决问题,可能需要使用更高级的工具或寻求专业帮助。
为了避免inode错误,用户应该定期备份数据并保护硬件免受损坏。
此外,定期进行文件系统检查也可以帮助发现和修复inode错误。
总之,Linux writeback error on inode是Linux文件系统中一个常见的问题,可能导致数据丢失或损坏。
为了避免这些问题,用户应该定期备份数据并保护硬件免受损坏,并在必要时使用文件系统工具来检查和修复inode错误。
- 1 -。
linux命令执行返回值(附错误对照表)费元星
linux命令执⾏返回值(附错误对照表)费元星在 Linux 下,不管你是启动⼀个桌⾯程序也好,还是在控制台下运⾏命令,所有的程序在结束时,都会返回⼀个数字值,这个值叫做返回值,或者称为错误号 ( Error Number )。
在控制台下,有⼀个特殊的环境变量 $?,保存着前⼀个程序的返回值,我们可以试试:$ ls *.pngDiagram1.png eqn.png peazip.pngeqn4.png Mandelbrot.png x2.png$ echo $?先随便执⾏个命令,⽐如像上⾯的 ls 某些⽂件,然后通过 echo $?,打印 $? 的值~我们发现返回值是 0,这是什么意思呢?只要返回值是 0,就代表程序执⾏成功了~也就是说,如果 $? 变量的值不是 0 的话,就表⽰上⼀个命令在执⾏的过程中出错了。
我们可以试着 ls ⼀个不存在的⽂件:$ ls linuxgemls: ⽆法访问 linuxgem: 没有那个⽂件或⽬录$ echo $?2这样,对于某些打印出⼀堆不熟悉的英⽂信息的命令,可以⽅便的看出它是否成功执⾏结束。
不过,每次都 echo $? ⼀下太累了,没关系,你可以把 $? 放在提⽰符⾥去:galeki@localhost ~ $ export PS1="[\$?]${PS1}"[0]galeki@localhost ~ $export PS1="[\$?]${PS1}" 这个命令把 $? 的值放在的提⽰符的最前⾯,这样每次执⾏完命令,这个值都会⾃动更新,这下就⼀⽬了然了~那么如果返回的值不是 0,我们要怎么知道是那⾥出错了呢?⼤多数的程序出错都会给出提⽰,如果没有提⽰的话,可以⽤ perror 这个程序来查看错误的信息,⽐如返回值是 2,我们可以运⾏:$ perror 2OS error code 2: No such file or directory这样就清楚了,原来是⽂件不存在~错误对照表:"OS error code 1: Operation not permitted""OS error code 2: No such file or directory""OS error code 3: No such process""OS error code 4: Interrupted system call""OS error code 5: Input/output error""OS error code 6: No such device or address""OS error code 7: Argument list too long""OS error code 8: Exec format error""OS error code 9: Bad file descriptor""OS error code 10: No child processes""OS error code 11: Resource temporarily unavailable""OS error code 12: Cannot allocate memory""OS error code 13: Permission denied""OS error code 14: Bad address""OS error code 15: Block device required""OS error code 16: Device or resource busy""OS error code 17: File exists""OS error code 18: Invalid cross-device link""OS error code 19: No such device""OS error code 20: Not a directory""OS error code 21: Is a directory""OS error code 22: Invalid argument""OS error code 23: Too many open files in system""OS error code 24: Too many open files""OS error code 25: Inappropriate ioctl for device""OS error code 26: Text file busy""OS error code 27: File too large""OS error code 28: No space left on device""OS error code 29: Illegal seek""OS error code 30: Read-only file system""OS error code 31: Too many links""OS error code 32: Broken pipe""OS error code 33: Numerical argument out of domain""OS error code 34: Numerical result out of range""OS error code 35: Resource deadlock avoided""OS error code 36: File name too long""OS error code 37: No locks available""OS error code 38: Function not implemented""OS error code 39: Directory not empty""OS error code 40: Too many levels of symbolic links""OS error code 42: No message of desired type""OS error code 43: Identifier removed""OS error code 44: Channel number out of range""OS error code 45: Level 2 not synchronized""OS error code 46: Level 3 halted""OS error code 47: Level 3 reset""OS error code 48: Link number out of range""OS error code 49: Protocol driver not attached""OS error code 50: No CSI structure available""OS error code 51: Level 2 halted""OS error code 52: Invalid exchange""OS error code 53: Invalid request descriptor""OS error code 54: Exchange full""OS error code 55: No anode""OS error code 56: Invalid request code""OS error code 57: Invalid slot""OS error code 59: Bad font file format""OS error code 60: Device not a stream""OS error code 61: No data available""OS error code 62: Timer expired""OS error code 63: Out of streams resources""OS error code 64: Machine is not on the network""OS error code 65: Package not installed""OS error code 66: Object is remote""OS error code 67: Link has been severed""OS error code 68: Advertise error""OS error code 69: Srmount error""OS error code 70: Communication error on send""OS error code 71: Protocol error""OS error code 72: Multihop attempted""OS error code 73: RFS specific error""OS error code 74: Bad message""OS error code 75: Value too large for defined data type""OS error code 76: Name not unique on network""OS error code 77: File descriptor in bad state""OS error code 78: Remote address changed""OS error code 79: Can not access a needed shared library""OS error code 80: Accessing a corrupted shared library""OS error code 81: .lib section in a.out corrupted""OS error code 82: Attempting to link in too many shared libraries" "OS error code 83: Cannot exec a shared library directly""OS error code 84: Invalid or incomplete multibyte or wide character" "OS error code 85: Interrupted system call should be restarted" "OS error code 86: Streams pipe error""OS error code 87: Too many users""OS error code 88: Socket operation on non-socket""OS error code 89: Destination address required""OS error code 90: Message too long""OS error code 91: Protocol wrong type for socket""OS error code 92: Protocol not available""OS error code 93: Protocol not supported""OS error code 94: Socket type not supported""OS error code 95: Operation not supported""OS error code 96: Protocol family not supported""OS error code 97: Address family not supported by protocol""OS error code 98: Address already in use""OS error code 99: Cannot assign requested address""OS error code 100: Network is down""OS error code 101: Network is unreachable""OS error code 102: Network dropped connection on reset""OS error code 103: Software caused connection abort""OS error code 104: Connection reset by peer""OS error code 105: No buffer space available""OS error code 106: Transport endpoint is already connected""OS error code 107: Transport endpoint is not connected""OS error code 108: Cannot send after transport endpoint shutdown""OS error code 109: Too many references: cannot splice""OS error code 110: Connection timed out""OS error code 111: Connection refused""OS error code 112: Host is down""OS error code 113: No route to host""OS error code 114: Operation already in progress""OS error code 115: Operation now in progress""OS error code 116: Stale NFS file handle""OS error code 117: Structure needs cleaning""OS error code 118: Not a XENIX named type file""OS error code 119: No XENIX semaphores available""OS error code 120: Is a named type file""OS error code 121: Remote I/O error""OS error code 122: Disk quota exceeded""OS error code 123: No medium found""OS error code 124: Wrong medium type""OS error code 125: Operation canceled""OS error code 126: Required key not available""OS error code 127: Key has expired""OS error code 128: Key has been revoked""OS error code 129: Key was rejected by service""OS error code 130: Owner died""OS error code 131: State not recoverable""MySQL error code 132: Old database file""MySQL error code 133: No record read before update""MySQL error code 134: Record was already deleted (or record file crashed)" "MySQL error code 135: No more room in record file""MySQL error code 136: No more room in index file""MySQL error code 137: No more records (read after end of file)""MySQL error code 138: Unsupported extension used for table""MySQL error code 139: Too big row""MySQL error code 140: Wrong create options""MySQL error code 141: Duplicate unique key or constraint on write or update" "MySQL error code 142: Unknown character set used""MySQL error code 143: Conflicting table definitions in sub-tables of MERGE table" "MySQL error code 144: Table is crashed and last repair failed""MySQL error code 145: Table was marked as crashed and should be repaired" "MySQL error code 146: Lock timed out; Retry transaction""MySQL error code 147: Lock table is full; Restart program with a larger locktable" "MySQL error code 148: Updates are not allowed under a read only transactions" "MySQL error code 149: Lock deadlock; Retry transaction""MySQL error code 150: Foreign key constraint is incorrectly formed""MySQL error code 151: Cannot add a child row""MySQL error code 152: Cannot delete a parent row"。
errorcode错误代码含义查询
error code(错误代码)=0是操作成功完成。
error code(错误代码)=1是功能错误。
error code(错误代码)=2是系统找不到指定的文件。
error code(错误代码)=3是系统找不到指定的路径。
error code(错误代码)=4是系统无法打开文件。
error code(错误代码)=5是拒绝访问。
error code(错误代码)=6是句柄无效。
error code(错误代码)=7是存储控制块被损坏。
error code(错误代码)=8是存储空间不足,无法处理此命令。
error code(错误代码)=9是存储控制块地址无效。
error code(错误代码)=10是环境错误。
error code(错误代码)=11是试图加载格式错误的程序。
error code(错误代码)=12是访问码无效。
error code(错误代码)=13是数据无效。
error code(错误代码)=14是存储器不足,无法完成此操作。
error code(错误代码)=15是系统找不到指定的驱动器。
error code(错误代码)=16是无法删除目录。
error code(错误代码)=17是系统无法将文件移到不同的驱动器。
error code(错误代码)=18是没有更多文件。
error code(错误代码)=19是介质受写入保护。
error code(错误代码)=20是系统找不到指定的设备。
error code(错误代码)=21是设备未就绪。
error code(错误代码)=22是设备不识别此命令。
error code(错误代码)=23是数据错误(循环冗余检查)。
error code(错误代码)=24是程序发出命令,但命令长度不正确。
error code(错误代码)=25是驱动器无法找出磁盘上特定区域或磁道的位置。
error code(错误代码)=26是无法访问指定的磁盘或软盘。
error code(错误代码)=27是驱动器找不到请求的扇区。
Linux错误处理与错误号
Linux错误处理与错误号每天只要进步一点点!09-11-24小知识:li nux从文本界面启动:首先进入roo t权限,在fedor a下,终端输入:su root;输入你的密码;进入root权限下,使用shell,vi /etc/i nitta b,修改i nitta b文件,把id:5:initd efaul t的5改成3。
其他几种对应的模式如下: 0 关机 1 单用户模式2 多用户模式,但是不支持网络访问 3多用户模式,文本模式启动 4无定义的5 图形化界面 6重启进入图形界面start x,就OK了,当然前提是装了图形界面文件权限:4:读相当于r2:写相当于w1:执行相当二x常用7 可读可写可执行6 可读可写 5 可读可执行 4只可读Linu x错误机制1,在用户进行文件操作的时候,会出各种各样的错误,比如权限不足,空间不足,找不到文件等,此时需在程序中设置错误捕捉语句,并显示错误.在li nux中错误定义成了错误号和错误常数,如果发生错误,便宜会返回在终端上可以用以下命令来查看错误的定义: cat/usr/inclu de/as m/err no.h如下:#i fndef _I386_ERR NO_H#defi ne _I386_E RRNO_H#de fineEPERM 1 /* Ope ratio n not perm itted */#defin e ENO ENT 2 /* N o suc h fil e ordirec tory*/#d efine ESRC H 3/* No such proc ess */#de fineEINTR 4 /* Int errup ted s ystem call */#defin e EIO5 /* I/O er ror */#de fineENXIO 6 /* Nosuchdevic e oraddre ss */#def ine E2BIG 7 /* Arglisttoo l ong */#de fineENOEX EC 8 /* Exe c for mat e rror*/#d efine EBAD F 9/* Ba d fil e num ber */#de fineECHIL D 10 /* Nochild proc esses */#defin e EAG AIN 11 /* T ry ag ain */#de fineENOME M 12 /* Out of m emory */#defin e EAC CES 13 /* P ermis siondenie d */#defi ne EF AULT14 /*Bad a ddres s */#defi ne EN OTBLK15 /*Block devi ce re quire d */#defi ne EB USY 16 /*Devic e orresou rce b usy */#de fineEEXIS T 17 /* Fil e exi sts */#de fineEXDEV 18 /* Cro ss-de vicelink*/#d efine ENOD EV 19/* No such devi ce */#def ine E NOTDI R 20 /* Nota dir ector y */#defi ne EI SDIR21 /*Is adirec tory*/#d efine EINV AL 22/* In valid argu ment*/#d efine ENFI LE 23/* Fi le ta ble o verfl ow */#def ine E MFILE24 /* Toomanyopenfiles */#defin e ENO TTY 25 /* N ot atypew riter */#defin e ETX TBSY 26 /* T ext f ile b usy */#de fineEFBIG 27 /* Fil e too larg e */#defi ne EN OSPC28 /*No sp ace l eft o n dev ice */#de fineESPIP E 29 /* Ill egalseek*/#d efine EROF S 30/* Re ad-on ly fi le sy stem*/#d efine EMLI NK 31/* To o man y lin ks */#def ine E PIPE32 /* Brok en pi pe */#def ine E DOM 33 /* Math argu mentout o f dom ain o f fun c */#defi ne ER ANGE34 /*Mathresul t not repr esent able*/#d efine EDEA DLK 35/* Re sourc e dea dlock woul d occ ur */#def ine E NAMET OOLON G 36 /* File name toolong*/#d efine ENOL CK 37/* No reco rd lo cks a vaila ble */#de fineENOSY S 38 /* Fun ction notimple mente d */#defi ne EN OTEMP TY 39 /*Direc torynot e mpty*/#d efine ELOO P 40/* To o man y sym bolic link s enc ounte red */ #de fineEWOUL DBLOC K EAGA IN /* Ope ratio n wou ld bl ock */#de fineENOMS G 42 /* Nomessa ge of desi red t ype */#de fineEIDRM 43 /* Ide ntifi er re moved */#defin e ECH RNG 44 /* C hanne l num ber o ut of rang e */#defi ne EL2NSYN C 45 /*Level 2 no t syn chron ized*/#d efine EL3H LT 46/* Le vel 3 halt ed */#def ine E L3RST47 /* Leve l 3 r eset*/#d efine ELNR NG 48/* Li nk nu mberout o f ran ge */#def ine E UNATC H 49 /* Prot ocoldrive r not atta ched*/#d efine ENOC SI 50/* No CSIstruc tureavail able*/#d efine EL2H LT 51/* Le vel 2 halt ed */#def ine E BADE52 /* Inva lid e xchan ge */#def ine E BADR53 /* Inva lid r eques t des cript or */#def ine E XFULL54 /* Exch angefull*/#d efine ENOA NO 55/* No anod e */#defi ne EB ADRQC56 /*Inval id re quest code */#defin e EBA DSLT 57 /* I nvali d slo t */#defi ne ED EADLO CK E DEADL K#de fineEBFON T 59 /* Bad font file form at */#def ine E NOSTR60 /* Devi ce no t a s tream */#defin e ENO DATA 61 /* N o dat a ava ilabl e */#defi ne ET IME 62 /*Timer expi red */#de fineENOSR 63 /* Out of s tream s res ource s */#defi ne EN ONET64 /*Machi ne is noton th e net work*/#d efine ENOP KG 65/* Pa ckage notinsta lled*/#d efine EREM OTE 66/* Ob jectis re mote*/#d efine ENOL INK 67/* Li nk ha s bee n sev ered*/#d efine EADV 68/* Ad verti se er ror */#de fineESRMN T 69 /* Srm ounterror */#defin e ECO MM 70 /* C ommun icati on er ror o n sen d */#defi ne EP ROTO71 /*Proto col e rror*/#d efine EMUL TIHOP 72/* Mu ltiho p att empte d */#defi ne ED OTDOT73 /*RFS s pecif ic er ror */#de fineEBADM SG 74 /* Not a da ta me ssage */#defin e EOV ERFLO W 75 /* V aluetoo l argefor d efine d dat a typ e */#defi ne EN OTUNI Q 76 /*Namenot u nique on n etwor k */#defi ne EB ADFD77 /*Filedescr iptor in b ad st ate */#de fineEREMC HG 78 /* Rem ote a ddres s cha nged*/#d efine ELIB ACC 79/* Ca n not acce ss aneede d sha red l ibrar y */#defi ne EL IBBAD80 /*Acces singa cor rupte d sha red l ibrar y */#defi ne EL IBSCN81 /*.libsecti on in a.ou t cor rupte d */#defi ne EL IBMAX82 /*Attem pting to l ink i n too many shar ed li brari es */ #def ine E LIBEX EC 83 /* Cann ot ex ec ashare d lib rarydirec tly */#de fineEILSE Q 84 /* Ill egalbyteseque nce */#de fineEREST ART 85 /* Int errup ted s ystem call shou ld be rest arted */#defin e EST RPIPE 86 /* S tream s pip e err or */#def ine E USERS87 /* Toomanyusers */#defin e ENO TSOCK 88 /* S ocket oper ation on n on-so cket*/#d efine EDES TADDR REQ 89/* De stina tionaddre ss re quire d */#defi ne EM SGSIZ E 90 /*Messa ge to o lon g */#defi ne EP ROTOT YPE 91 /*Proto col w rongtypefor s ocket */#defin e ENO PROTO OPT 92 /* P rotoc ol no t ava ilabl e */#defi ne EP ROTON OSUPP ORT 93 /*Proto col n ot su pport ed */#def ine E SOCKT NOSUP PORT94 /* Sock et ty pe no t sup porte d */#defi ne EO PNOTS UPP 95 /*Opera tionnot s uppor ted o n tra nspor t end point */ #defin e EPF NOSUP PORT 96 /* P rotoc ol fa milynot s uppor ted */#de fineEAFNO SUPPO RT 97 /* Add ressfamil y not supp orted by p rotoc ol */ #def ine E ADDRI NUSE98 /* Addr ess a lread y inuse */#de fineEADDR NOTAV AIL 99 /* Can not a ssign requ ested addr ess */#de fineENETD OWN 100/* Net workis do wn */#def ine E NETUN REACH101 /* Netw ork i s unr eacha ble */#de fineENETR ESET 102/* Net workdropp ed co nnect ion b ecaus e ofreset */ #defin e ECO NNABO RTED 103 /* S oftwa re ca usedconne ction abor t */#defi ne EC ONNRE SET 104 /*Conne ction rese t bypeer*/#d efine ENOB UFS 105/* No buff er sp ace a vaila ble */#de fineEISCO NN 106/* Tra nspor t end point is a lread y con necte d */#defi ne EN OTCON N 107 /*Trans portendpo int i s not conn ected */#defin e ESH UTDOW N 108 /* C annot send afte r tra nspor t end point shut down*/ #d efine ETOO MANYR EFS 109/* To o man y ref erenc es: c annot spli ce */#def ine E TIMED OUT 110 /* Conn ectio n tim ed ou t */#defi ne EC ONNRE FUSED111 /*Conne ction refu sed */#de fineEHOST DOWN 112/* Hos t isdown*/#d efine EHOS TUNRE ACH 113/* No rout e tohost*/#d efine EALR EADY 114/* Op erati on al ready in p rogre ss */#def ine E INPRO GRESS115 /* Oper ation nowin pr ogres s */#defi ne ES TALE116 /*Stale NFSfilehandl e */#defi ne EU CLEAN117 /*Struc tureneeds clea ning*/#d efine ENOT NAM 118/* No t a X ENIXnamed type file */#defin e ENA VAIL 119 /* N o XEN IX se mapho res a vaila ble */#de fineEISNA M 120/* Isa nam ed ty pe fi le */#def ine E REMOT EIO 121 /* Remo te I/O err or */#def ine E DQUOT122 /* Quot a exc eeded */#defin e ENO MEDIU M 123 /* N o med ium f ound*/#d efine EMED IUMTY PE 124/* Wr ong m edium type */#endif通过st rerro r函数来显示错误信息输入以下程序:#inclu de#inclu de#inclu de /*包含错误处理的头文件*/i nt ma in(vo id){print f("EN OENT:\n");c har *mesg= str error(ENOE NT);pr intf(" Er rno :%d\n",ENO ENT);p rintf(" M essag e:%s\n",me sg);pr intf("EIO:\n");char*mesg1 = s trerr or(EI O); pri ntf(" Err no :%d\n",EIO);print f(" Messa ge:%s\n",m esg1);print f("EE XIST:\n");char*mesg2 = s trerr or(EE XIST);print f(" Errno :%d\n",E EXIST); prin tf(" Mess age:%s\n",mesg2);}编译运行结果如下:ENOEN T:Errno :2Mes sage:No su ch fi le or dire ctoryEIO:Messa ge:In put/o utput erro rEEX IST :E rrno :17Mes sage:Fileexist s下面用序号显示错误信息c har *strer rno(i nt er ronum)输入以下源程序:#inc lude#inc lude#inc ludeintmain(void){ int i; fo r(i=0;i编译运行如下:errn o :0messa ge :S ucces serr no :1mess age :Opera tionnot p ermit tede rrno:2me ssage :Nosuchfileor di recto ryer rno :3mes sage:No s uch p roces serr no :4mess age :Inter rupte d sys tem c alle rrno:5me ssage :Inp ut/ou tputerrorerrn o :6messa ge :N o suc h dev ice o r add resserrno :7m essag e :Ar gumen t lis t too longerrn o :8messa ge :E xec f ormat erro rerr no :9mess age :Bad f ile d escri ptorerrno :10messa ge :N o chi ld pr ocess eser rno :11me ssage :Res ource temp orari ly un avail ableerrno :12messa ge :C annot allo catememor yerr no :13mes sage:Perm issio n den iede rrno:14m essag e :Ba d add ressmessa ge :B lockdevic e req uired# _i386_e rrno_h标识#定义_i386_er rno_h#定义e perm 1 / * * /操作不允许#定义en oent2 / * * /没有这样的文件或目录#定义es rch 3 / ** /没有这样的过程#定义e intr 4 / * * /中断系统调用#定义操作错误5 / ** / /错误#定义enxi o 6 / *没有这样的设备或地址* / #定义e2big7 / * * /参数表太长#定义en oexec8 /* * /执行格式错误#定义ebadf9 /* * /错误的文件编号#定义echi ld 10 / ** /无子过程#定义eaga in 11 / ** /再试一次#定义enom em 12 / ** /内存不足#定义eacc es 13 / ** /拒绝许可#定义efau lt 14 / ** /坏地址#定义enotb lk 15 / ** /块设备请求#定义设备的16 / * */设备或资源忙#定义eexi st 17 / ** /文件存在#定义exde v 18/ * * /交叉链接#定义enode v 19/ * * /没有这种装置#定义eno tdir20 /* * /不是一个目录#定义eisdi r 21/ * * /目录#定义ei nval22 /* * /参数无效#定义en file23 /* * /文件表溢出#定义e mfile24 / * */打开文件太多#定义enot ty 25 / ** /没有打字机#定义etx tbsy26 /* * /文本文件忙#定义e fbig27 /* * /文件太大#定义en ospc28 /* * /设备上没有空间了#定义esp ipe 29 / *非法谋取* /#定义erof s 30/ * * /只读文件系统#定义eml ink 31 / * * /太多的链接#定义ep ipe 32 / * * /断管#定义以东33 / *数学论证的域名功能*/ #定义erang e 34/ * * /不可表示的数学结果#定义edead lk 35 / ** /会发生资源死锁#ena metoo long36 /* * /文件名太长#定义e nolck37 / *没有记录锁可*/#定义enosy s 38/ * * /功能没有实现#定义eno tempt y 39/ * * /目录不空#定义eloop40 / * */遇到太多的符号链接#定义e would block eaga in /* * /操作将阻塞#定义e nomsg42 / * */没有期望类型的消息#定义e idrm43 /* * /标识符删除#定义e chrng44 / * */频道数目超出范围#定义el2nsyn c 45/ * * /2级不同步#定义el3h lt 46 / ** /3级中断#定义el3r st 47 / ** /3级复位#定义elnr ng 48 / ** /链接数超出范围#定义e unatc h 49/ * * /不附协议驱动#定义eno csi 50 / * * /没有倡议结构可用#定义el2h lt 51 / ** /2级中断#定义ebad e 52/ * * /无效的交换#定义ebad r 53/ * * /无效请求描述符#定义ex full54 /* * /交流全#定义eno ano 55 / * * /阳极#定义ebadr qc 56 / ** /无效的请求代码#定义e badsl t 57/ * * /无效槽# ed eadlo ck ed eadlk定义#定义ebfo nt 59 / ** /错误的字体文件格式#定义enos tr 60 / ** /不流装置#定义enod ata 61 / * * /无可用数据#定义和62 / * */计时器过期#定义enosr63 / * */资源的溪流#定义enone t 64/ *机上的不是网* /#定义enop kg 65 / ** /没有安装软件包#定义e remot e 66/ * * /对象是远程的#定义eno link67 /* * /联系被切断#定义马腺病毒68 / * * /宣传错误#定义esr mnt 69 / * * /srmou nt误差#定义在70 / * */通讯错误发送#定义epro to 71 / ** /协议错误#定义emul tihop72 / * */跳企图#定义ed otdot 73 / * */具体错误率#定义ebadm sg 74 / ** /没有数据信息#定义eo verfl ow 75 / *值太大,定义数据类型* / #定义enot uniq76 /* * /网络名称不唯一#定义ebad fd 77 / ** /文件描述符在坏状态#定义erem chg 78 / * * /远程地址改变了#定义eliba cc 79 / *无法访问必要的共享库* /#定义elib bad 80 / * * /访问损坏的共享库#定义elib scn 81 / * . ou t。
fsck failed with error code
fsck failed with error code“fsck failed with error code” 是一个常见的错误消息,通常出现在Linux操作系统中。
fsck是文件系统一致性检查的缩写,它用于检查和修复文件系统中的错误。
当fsck失败并返回错误代码时,通常表示文件系统存在问题,需要进行修复。
出现这个错误的原因可能有很多,比如文件系统损坏、磁盘问题、系统配置不当等。
为了解决这个问题,你可以尝试以下方法:1. 检查磁盘错误:运行fsck命令时,可以加上“-f”参数来强制检查文件系统的一致性。
如果fsck发现错误,它会尝试修复它们。
例如:```sudo fsck -f /dev/sdx1```其中,“/dev/sdx1”是你的文件系统所在的分区。
2. 检查文件系统一致性:如果你不确定文件系统是否有问题,可以运行fsck命令进行检查。
如果没有问题,fsck会告诉你一切正常。
如果有问题,它会尝试修复它们。
例如:```sudo fsck /dev/sdx1```3. 检查磁盘健康状况:有时候磁盘本身可能存在问题,导致文件系统损坏。
你可以使用工具如smartmontools来检查磁盘的健康状况。
如果发现磁盘存在问题,可能需要更换磁盘。
4. 检查系统日志:查看系统日志文件(如/var/log/messages或/var/log/syslog)可能会提供更多关于fsck失败的错误信息。
你可以使用以下命令查看日志文件:```bashsudo cat /var/log/messages | grep fsck```或者```bashsudo cat /var/log/syslog | grep fsck```5. 寻求专业帮助:如果你无法解决这个问题,可能需要寻求专业人士的帮助。
他们可以提供更详细的诊断和修复方案。
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系统错误编码及提示
系统运维工程师和系统开发工程师在日常工作中,经常会遇到此类问题“当你进行了一些不当操作,系统会给你错误提示”,这些错误提示在操作系统中都是错误编码的,每一个提示对应一个错误编码,错误编码供程序代码中方便调用,接下来我们会打印出linux操作系统的错误编码及提示,如下:一、系统环境系统版本:内核版本:二、程序代码代码如下:三、编译运行结果如下:[root@CentOS6 erro_num]# gcc error_num.c[root@centos6 erro_num]# ./a.out0:Success1:Operation not permitted2:No such file or directory3:No such process4:Interrupted system call5:Input/output error6:No such device or address7:Argument list too long8:Exec format error9:Bad file descriptor10:No child processes11:Resource temporarily unavailable 12:Cannot allocate memory13:Permission denied14:Bad address15:Block device required16:Device or resource busy17:File exists18:Invalid cross-device link19:No such device20:Not a directory21:Is a directory22:Invalid argument23:Too many open files in system 24:Too many open files25:Inappropriate ioctl for device 26:Text file busy27:File too large28:No space left on device29:Illegal seek30:Read-only file system31:Too many links32:Broken pipe33:Numerical argument out of domain 34:Numerical result out of range 35:Resource deadlock avoided36:File name too long37:No locks available38:Function not implemented39:Directory not empty40:Too many levels of symbolic links 41:Unknown error 4142:No message of desired type43:Identifier removed44:Channel number out of range 45:Level 2 not synchronized46:Level 3 halted47:Level 3 reset48:Link number out of range49:Protocol driver not attached50:No CSI structure available51:Level 2 halted52:Invalid exchange53:Invalid request descriptor54:Exchange full55:No anode56:Invalid request code57:Invalid slot58:Unknown error 5859:Bad font file format60:Device not a stream61:No data available62:Timer expired63:Out of streams resources64:Machine is not on the network65:Package not installed66:Object is remote67:Link has been severed68:Advertise error69:Srmount error70:Communication error on send71:Protocol error72:Multihop attempted73:RFS specific error74:Bad message75:Value too large for defined data type76:Name not unique on network77:File descriptor in bad state78:Remote address changed79:Can not access a needed shared library80:Accessing a corrupted shared library81:.lib section in a.out corrupted82:Attempting to link in too many shared libraries 83:Cannot exec a shared library directly84:Invalid or incomplete multibyte or wide character 85:Interrupted system call should be restarted 86:Streams pipe error87:Too many users88:Socket operation on non-socket89:Destination address required90:Message too long91:Protocol wrong type for socket92:Protocol not available93:Protocol not supported94:Socket type not supported95:Operation not supported96:Protocol family not supported97:Address family not supported by protocol98:Address already in use99:Cannot assign requested address100:Network is down101:Network is unreachable102:Network dropped connection on reset103:Software caused connection abort104:Connection reset by peer105:No buffer space available106:Transport endpoint is already connected 107:Transport endpoint is not connected108:Cannot send after transport endpoint shutdown 109:Too many references: cannot splice110:Connection timed out111:Connection refused112:Host is down113:No route to host114:Operation already in progress115:Operation now in progress116:Stale NFS file handle117:Structure needs cleaning118:Not a XENIX named type file119:No XENIX semaphores available120:Is a named type file121:Remote I/O error122:Disk quota exceeded123:No medium found124:Wrong medium type125:Operation canceled126:Required key not available127:Key has expired128:Key has been revoked129:Key was rejected by service130:Owner died131:State not recoverable如果你看过nginx-1.0.10源码,里面有一个类似的错误编码预定义135个,在objs/ngx_auto_config.h 中,#define NGX_SYS_NERR135,事实证明,这种思想是非常可取的,我们自己写软件的时候,不妨尝试一下?/儒道至圣最新章节。
Linux新手必读常见命令行错误及解决方法
Linux新手必读常见命令行错误及解决方法Linux操作系统作为一款强大且广泛应用的操作系统,其命令行界面是最为重要的一部分。
然而,对于新手来说,掌握命令行并不是一件容易的事情。
在使用过程中,经常会遇到各种错误提示,影响正常的使用体验。
本文将介绍一些常见的命令行错误以及解决方法,帮助Linux新手更好地应对各种情况。
错误一:命令找不到或不存在(Command not found)这是一个非常常见的错误,意味着输入的命令在当前的环境中没有找到。
这通常是由于命令不存在或者命令没有被正确地安装所致。
解决方法:1. 确保所输入的命令正确无误,检查是否拼写错误。
2. 使用适当的命令进行搜索。
例如,使用`which`命令可以查找某个命令的路径,例如`which command_name`。
3. 检查命令是否被正确地安装。
可以尝试使用`apt-get`或者`yum`等包管理器进行命令的安装。
4. 如果命令仍然无法找到,可能需要手动安装命令或者检查环境变量设置。
错误二:权限不足(Permission denied)Linux系统中,每个用户都有相应的权限来访问和执行文件。
当遇到权限不足的错误提示时,说明当前用户没有执行该命令的权限。
解决方法:1. 使用`sudo`命令,该命令可以提升当前用户的权限并执行命令。
例如,`sudo command_name`。
2. 如果当前用户没有sudo权限,则需要使用管理员账户来执行命令。
错误三:文件或目录不存在(No such file or directory)当输入的文件或者目录不存在时,就会出现这个错误提示。
这可能是由于输入错误的文件名或者目录路径所致。
解决方法:1. 确认输入的文件或者目录路径是否正确,并检查拼写错误。
2. 使用`ls`命令来查看当前目录下的文件和目录,确认所要操作的文件或目录是否存在。
错误四:命令语法错误(Syntax error)当输入的命令语法错误时,系统会提示命令的用法或者提供一些错误信息。
[Linux]命令返回值以及错误对照表
[Linux]命令返回值以及错误对照表Linux执⾏完命令之后默认会有⼀个返回值# lsapp backupconfig.json Doc manage.py __pycache__ settings.py# echo $?错误对照表"OS error code 1: Operation not permitted""OS error code 2: No such file or directory""OS error code 3: No such process""OS error code 4: Interrupted system call""OS error code 5: Input/output error""OS error code 6: No such device or address""OS error code 7: Argument list too long""OS error code 8: Exec format error""OS error code 9: Bad file descriptor""OS error code 10: No child processes""OS error code 11: Resource temporarily unavailable""OS error code 12: Cannot allocate memory""OS error code 13: Permission denied""OS error code 14: Bad address""OS error code 15: Block device required""OS error code 16: Device or resource busy""OS error code 17: File exists""OS error code 18: Invalid cross-device link""OS error code 19: No such device""OS error code 20: Not a directory""OS error code 21: Is a directory""OS error code 22: Invalid argument""OS error code 23: Too many open files in system""OS error code 24: Too many open files""OS error code 25: Inappropriate ioctl for device""OS error code 26: Text file busy""OS error code 27: File too large""OS error code 28: No space left on device""OS error code 29: Illegal seek""OS error code 30: Read-only file system""OS error code 31: Too many links""OS error code 32: Broken pipe""OS error code 33: Numerical argument out of domain""OS error code 34: Numerical result out of range""OS error code 35: Resource deadlock avoided""OS error code 36: File name too long""OS error code 37: No locks available""OS error code 38: Function not implemented""OS error code 39: Directory not empty""OS error code 40: Too many levels of symbolic links""OS error code 42: No message of desired type""OS error code 43: Identifier removed""OS error code 44: Channel number out of range""OS error code 45: Level 2 not synchronized""OS error code 46: Level 3 halted""OS error code 47: Level 3 reset""OS error code 48: Link number out of range""OS error code 49: Protocol driver not attached""OS error code 50: No CSI structure available""OS error code 51: Level 2 halted""OS error code 52: Invalid exchange""OS error code 53: Invalid request descriptor""OS error code 54: Exchange full""OS error code 55: No anode""OS error code 56: Invalid request code""OS error code 57: Invalid slot""OS error code 59: Bad font file format""OS error code 60: Device not a stream""OS error code 61: No data available""OS error code 62: Timer expired""OS error code 63: Out of streams resources""OS error code 64: Machine is not on the network""OS error code 65: Package not installed""OS error code 66: Object is remote""OS error code 67: Link has been severed""OS error code 68: Advertise error""OS error code 69: Srmount error""OS error code 70: Communication error on send""OS error code 71: Protocol error""OS error code 72: Multihop attempted""OS error code 73: RFS specific error""OS error code 74: Bad message""OS error code 75: Value too large for defined data type""OS error code 76: Name not unique on network""OS error code 77: File descriptor in bad state""OS error code 78: Remote address changed""OS error code 79: Can not access a needed shared library""OS error code 80: Accessing a corrupted shared library""OS error code 81: .lib section in a.out corrupted""OS error code 82: Attempting to link in too many shared libraries""OS error code 83: Cannot exec a shared library directly""OS error code 84: Invalid or incomplete multibyte or wide character""OS error code 85: Interrupted system call should be restarted""OS error code 86: Streams pipe error""OS error code 87: Too many users""OS error code 88: Socket operation on non-socket""OS error code 89: Destination address required""OS error code 90: Message too long""OS error code 91: Protocol wrong type for socket""OS error code 92: Protocol not available""OS error code 93: Protocol not supported""OS error code 94: Socket type not supported""OS error code 95: Operation not supported""OS error code 96: Protocol family not supported""OS error code 97: Address family not supported by protocol""OS error code 98: Address already in use""OS error code 99: Cannot assign requested address""OS error code 100: Network is down""OS error code 101: Network is unreachable""OS error code 102: Network dropped connection on reset""OS error code 103: Software caused connection abort""OS error code 104: Connection reset by peer""OS error code 105: No buffer space available""OS error code 106: Transport endpoint is already connected""OS error code 107: Transport endpoint is not connected""OS error code 108: Cannot send after transport endpoint shutdown""OS error code 109: Too many references: cannot splice""OS error code 110: Connection timed out""OS error code 111: Connection refused""OS error code 112: Host is down""OS error code 113: No route to host""OS error code 114: Operation already in progress""OS error code 115: Operation now in progress""OS error code 116: Stale NFS file handle""OS error code 117: Structure needs cleaning""OS error code 118: Not a XENIX named type file""OS error code 119: No XENIX semaphores available""OS error code 120: Is a named type file""OS error code 121: Remote I/O error""OS error code 122: Disk quota exceeded""OS error code 123: No medium found""OS error code 124: Wrong medium type""OS error code 125: Operation canceled""OS error code 126: Required key not available""OS error code 127: Key has expired""OS error code 128: Key has been revoked""OS error code 129: Key was rejected by service""OS error code 130: Owner died""OS error code 131: State not recoverable""MySQL error code 132: Old database file""MySQL error code 133: No record read before update""MySQL error code 134: Record was already deleted (or record file crashed)" "MySQL error code 135: No more room in record file""MySQL error code 136: No more room in index file""MySQL error code 137: No more records (read after end of file)""MySQL error code 138: Unsupported extension used for table""MySQL error code 139: Too big row""MySQL error code 140: Wrong create options""MySQL error code 141: Duplicate unique key or constraint on write or update" "MySQL error code 142: Unknown character set used""MySQL error code 143: Conflicting table definitions in sub-tables of MERGE table" "MySQL error code 144: Table is crashed and last repair failed""MySQL error code 145: Table was marked as crashed and should be repaired" "MySQL error code 146: Lock timed out; Retry transaction""MySQL error code 147: Lock table is full; Restart program with a larger locktable" "MySQL error code 148: Updates are not allowed under a read only transactions" "MySQL error code 149: Lock deadlock; Retry transaction""MySQL error code 150: Foreign key constraint is incorrectly formed""MySQL error code 151: Cannot add a child row""MySQL error code 152: Cannot delete a parent row"。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
OS error code 99: Cannot assign requested address
OS error code 100: Network is down
OS error code 101: Network is unreachable
OS error code 39: Directory not empty
OS error code 40: Too many levels of symbolic links
Illegal error code: 41
OS error code 42: No message of desired type
OS error code 84: Invalid or incomplete multibyte or wide character
OS error code 85: Interrupted system call should be restarted
OS error code 86: Streams pipe error
OS error code 91: Protocol wrong type for socket
OS error code 92: Protocol not available
OS error code 93: Protocol not supported
OS error code 94: Socket type not supported
OS error code 17: File exists
OS error code 18: Invalid cross-device link
OS error code 19: No such device
OS error code 20: Not a directory
OS error code 21: Is a directory
OS error code 105: No buffer space available
OS error code 106: Transport endpoint is already connected
OS error code 107: Transport endpoint is not connected
OS error code 31: Too many links
OS error code 32: Broken pipe
OS error code 33: Numerical argument out of domain
OS error code 34: Numerical result out of range
OS error code 102: Network dropped connection on reset
OS error code 103: Software caused connection abort
OS error code 104: Connection reset by peer
OS error code 13: Permission denied
OS error code 14: Bad address
OS error code 15: Block device required
OS error code 16: Device or resource busy
OS error code 1: Operation not permitted
OS error code 2: No such file or directory
OS error code 3: No such process
OS error code 4: Interrupted system call
OS error code 47: Level 3 reset
OS error code 48: Link number out of range
OS error code 49: Protocol driver not attached
OS error code 50: No CSI structure available
OS error code 77: File descriptor in bad state
OS error code 78: Remote address changed
OS error code 79: Can not access a needed shared library
OS error code 80: Accessing a corrupted shared library
OS error code 81: .lib section in a.out corrupted
OS error code 82: Attempting to link in too many shared libraries
OS error code 83: Cannot exec a shared library directly
OS error code 65: Package not installed
OS error code 66: Object is remote
OS error code 67: Link has been severed
OS error code 68: Advertise error
OS error code 73: RFS specific error
OS error code 74: Bad message
OS error code 75: Value too large for defined data type
OS error code 76: Name not unique on network
OS error code 22: Invalid argument
OS error code 23: Too many open files in system
OS error code 24: Too many open files
OS error code 25: Inappropriate ioctl for device
OS error code 51: Level 2 halted
OS error code 52: Invalid exchange
OS error code 53: Invalid request descriptor
OS error code 54: Exchange full
OS error code 55: No anode
OS error code 108: Cannot send after transport endpoint shutdown
OS error code 109: Too many references: cannot splice
OS error code 110: Connection timed out
OS error code 5: Input/output error
OS error code 6: No such device or address
OS error code 7: Argument list too long
OS error code 8: Exec format error
OS error code 9: Bad file descriptor
OS error code 10: No child processes
OS error code 11: Resource temporarily unavailable
OS error code 12: Cannot allocate memory
OS error code 61: No data available
OS error code 62: Timer expired
OS error code 63: Out of streams resources
OS error code 64: Machine is not on the network
OS error code 87: Too many users
OS error code 88: Socket operation on non-socket
OS error code 89: Destination address required
OS error code 90: Message too long
OS error code 26: Text file busy
OS error code 27: File too large
OS error code 28: No space left on device
OS error code 29: Illegal seek
OS error code 30: Read-only file system
OS error code 56: Invalid request code
OS error code 57: Invalid slot
Illegal error code: 58
OS error code 59: Bad font file format
OS error code 60: Device not a stream
OS error code 95: Operation not supported
OS error code 96: Protocol family not supported
OS error code 97: Address family not supported by protocol