linux 下各errno的意义

    技术2024-12-30  14

    linux 下各errno的意义 收藏 strerror(errno):获取errno对应的错误

    /****************************获取错误代码描述**************/

    #include <string.h> /* for strerror */#include <errno.h>#include <stdio.h>

    int main(int argc, char ** argv)        {        int i = 0;        for(i = 0; i < 256; i++)        printf("errno.%02d is: %s/n", i, strerror(i));        return 0;}

    /*****************************************************************/

    errno.00 is: Successerrno.01 is: Operation not permittederrno.02 is: No such file or directoryerrno.03 is: No such processerrno.04 is: Interrupted system callerrno.05 is: Input/output errorerrno.06 is: No such device or addresserrno.07 is: Argument list too longerrno.08 is: Exec format errorerrno.09 is: Bad file descriptorerrno.10 is: No child processeserrno.11 is: Resource temporarily unavailable[资源临时不可用](连续发送数据时候回出此错,加延时)errno.12 is: Cannot allocate memoryerrno.13 is: Permission deniederrno.14 is: Bad addresserrno.15 is: Block device requirederrno.16 is: Device or resource busyerrno.17 is: File existserrno.18 is: Invalid cross-device linkerrno.19 is: No such deviceerrno.20 is: Not a directoryerrno.21 is: Is a directoryerrno.22 is: Invalid argumenterrno.23 is: Too many open files in systemerrno.24 is: Too many open fileserrno.25 is: Inappropriate ioctl for deviceerrno.26 is: Text file busyerrno.27 is: File too largeerrno.28 is: No space left on deviceerrno.29 is: Illegal seekerrno.30 is: Read-only file systemerrno.31 is: Too many linkserrno.32 is: Broken pipe[断开的管道](原因:the broken pipe error occurs if one end of theTCP socket closes connection(using disconnect) or gets killed and the otherend tries to still write to it. An indication of a closed/terminatedconnection is a return value of 0 when you try to read from that socketusing recv. After receiving such an error, if you try to still write to thesocket, your process gets sent the SIGPIPE signal which kills it. )errno.33 is: Numerical argument out of domainerrno.34 is: Numerical result out of rangeerrno.35 is: Resource deadlock avoidederrno.36 is: File name too longerrno.37 is: No locks availableerrno.38 is: Function not implementederrno.39 is: Directory not emptyerrno.40 is: Too many levels of symbolic linkserrno.41 is: Unknown error 41errno.42 is: No message of desired typeerrno.43 is: Identifier removederrno.44 is: Channel number out of rangeerrno.45 is: Level 2 not synchronizederrno.46 is: Level 3 haltederrno.47 is: Level 3 reseterrno.48 is: Link number out of rangeerrno.49 is: Protocol driver not attachederrno.50 is: No CSI structure availableerrno.51 is: Level 2 haltederrno.52 is: Invalid exchangeerrno.53 is: Invalid request descriptorerrno.54 is: Exchange fullerrno.55 is: No anodeerrno.56 is: Invalid request codeerrno.57 is: Invalid sloterrno.58 is: Unknown error 58errno.59 is: Bad font file formaterrno.60 is: Device not a streamerrno.61 is: No data availableerrno.62 is: Timer expirederrno.63 is: Out of streams resourceserrno.64 is: Machine is not on the networkerrno.65 is: Package not installederrno.66 is: Object is remoteerrno.67 is: Link has been severederrno.68 is: Advertise errorerrno.69 is: Srmount errorerrno.70 is: Communication error on senderrno.71 is: Protocol errorerrno.72 is: Multihop attemptederrno.73 is: RFS specific errorerrno.74 is: Bad messageerrno.75 is: Value too large for defined data typeerrno.76 is: Name not unique on networkerrno.77 is: File descriptor in bad stateerrno.78 is: Remote address changederrno.79 is: Can not access a needed shared libraryerrno.80 is: Accessing a corrupted shared libraryerrno.81 is: .lib section in a.out corruptederrno.82 is: Attempting to link in too many shared librarieserrno.83 is: Cannot exec a shared library directlyerrno.84 is: Invalid or incomplete multibyte or wide charactererrno.85 is: Interrupted system call should be restartederrno.86 is: Streams pipe errorerrno.87 is: Too many userserrno.88 is: Socket operation on non-socketerrno.89 is: Destination address requirederrno.90 is: Message too longerrno.91 is: Protocol wrong type for socketerrno.92 is: Protocol not availableerrno.93 is: Protocol not supportederrno.94 is: Socket type not supportederrno.95 is: Operation not supportederrno.96 is: Protocol family not supportederrno.97 is: Address family not supported by protocolerrno.98 is: Address already in useerrno.99 is: Cannot assign requested addresserrno.100 is: Network is downerrno.101 is: Network is unreachableerrno.102 is: Network dropped connection on reseterrno.103 is: Software caused connection aborterrno.104 is: Connection reset by peer[l连接被对端重置]errno.105 is: No buffer space availableerrno.106 is: Transport endpoint is already connectederrno.107 is: Transport endpoint is not connectederrno.108 is: Cannot send after transport endpoint shutdownerrno.109 is: Too many references: cannot spliceerrno.110 is: Connection timed outerrno.111 is: Connection refusederrno.112 is: Host is downerrno.113 is: No route to hosterrno.114 is: Operation already in progresserrno.115 is: Operation now in progresserrno.116 is: Stale NFS file handleerrno.117 is: Structure needs cleaningerrno.118 is: Not a XENIX named type fileerrno.119 is: No XENIX semaphores availableerrno.120 is: Is a named type fileerrno.121 is: Remote I/O errorerrno.122 is: Disk quota exceedederrno.123 is: No medium founderrno.124 is: Wrong medium typeerrno.125 is: Operation cancelederrno.126 is: Required key not availableerrno.127 is: Key has expirederrno.128 is: Key has been revokederrno.129 is: Key was rejected by serviceerrno.130 is: Owner diederrno.131 is: State not recoverableerrno.132 is: Unknown error 132132-255 全是Unknown error

     

    本文来自博客,转载请标明出处:http://blog.csdn.net/kofiory/archive/2010/08/05/5790409.aspx

    最新回复(0)