1、使用了一个小程序输出所有的errno对应的error字符串,代码如下
#include <errno.h> void showError(int err) { printf("errno : %5d , error : %s\n", err, strerror(err));}void showAllErr() { int i = 0; for(;i < 256; i++) { showError(i); }}int main(int argc, char * argv[]) { showAllErr();return 0; } |
2、运行上面代码,结果如下
errno : 0 , error : Success
errno : 1 , error : Operation not permittederrno : 2 , error : No such file or directoryerrno : 3 , error : No such processerrno : 4 , error : Interrupted system callerrno : 5 , error : Input/output errorerrno : 6 , error : No such device or addresserrno : 7 , error : Argument list too longerrno : 8 , error : Exec format errorerrno : 9 , error : Bad file descriptorerrno : 10 , error : No child processeserrno : 11 , error : Resource temporarily unavailableerrno : 12 , error : Cannot allocate memoryerrno : 13 , error : Permission deniederrno : 14 , error : Bad addresserrno : 15 , error : Block device requirederrno : 16 , error : Device or resource busyerrno : 17 , error : File existserrno : 18 , error : Invalid cross-device linkerrno : 19 , error : No such deviceerrno : 20 , error : Not a directoryerrno : 21 , error : Is a directoryerrno : 22 , error : Invalid argumenterrno : 23 , error : Too many open files in systemerrno : 24 , error : Too many open fileserrno : 25 , error : Inappropriate ioctl for deviceerrno : 26 , error : Text file busyerrno : 27 , error : File too largeerrno : 28 , error : No space left on deviceerrno : 29 , error : Illegal seekerrno : 30 , error : Read-only file systemerrno : 31 , error : Too many linkserrno : 32 , error : Broken pipeerrno : 33 , error : Numerical argument out of domainerrno : 34 , error : Numerical result out of rangeerrno : 35 , error : Resource deadlock avoidederrno : 36 , error : File name too longerrno : 37 , error : No locks availableerrno : 38 , error : Function not implementederrno : 39 , error : Directory not emptyerrno : 40 , error : Too many levels of symbolic linkserrno : 41 , error : Unknown error 41errno : 42 , error : No message of desired typeerrno : 43 , error : Identifier removederrno : 44 , error : Channel number out of rangeerrno : 45 , error : Level 2 not synchronizederrno : 46 , error : Level 3 haltederrno : 47 , error : Level 3 reseterrno : 48 , error : Link number out of rangeerrno : 49 , error : Protocol driver not attachederrno : 50 , error : No CSI structure availableerrno : 51 , error : Level 2 haltederrno : 52 , error : Invalid exchangeerrno : 53 , error : Invalid request descriptorerrno : 54 , error : Exchange fullerrno : 55 , error : No anodeerrno : 56 , error : Invalid request codeerrno : 57 , error : Invalid sloterrno : 58 , error : Unknown error 58errno : 59 , error : Bad font file formaterrno : 60 , error : Device not a streamerrno : 61 , error : No data availableerrno : 62 , error : Timer expirederrno : 63 , error : Out of streams resourceserrno : 64 , error : Machine is not on the networkerrno : 65 , error : Package not installederrno : 66 , error : Object is remoteerrno : 67 , error : Link has been severederrno : 68 , error : Advertise errorerrno : 69 , error : Srmount errorerrno : 70 , error : Communication error on senderrno : 71 , error : Protocol errorerrno : 72 , error : Multihop attemptederrno : 73 , error : RFS specific errorerrno : 74 , error : Bad messageerrno : 75 , error : Value too large for defined data typeerrno : 76 , error : Name not unique on networkerrno : 77 , error : File descriptor in bad stateerrno : 78 , error : Remote address changederrno : 79 , error : Can not access a needed shared libraryerrno : 80 , error : Accessing a corrupted shared libraryerrno : 81 , error : .lib section in a.out corruptederrno : 82 , error : Attempting to link in too many shared librarieserrno : 83 , error : Cannot exec a shared library directlyerrno : 84 , error : Invalid or incomplete multibyte or wide charactererrno : 85 , error : Interrupted system call should be restartederrno : 86 , error : Streams pipe errorerrno : 87 , error : Too many userserrno : 88 , error : Socket operation on non-socketerrno : 89 , error : Destination address requirederrno : 90 , error : Message too longerrno : 91 , error : Protocol wrong type for socketerrno : 92 , error : Protocol not availableerrno : 93 , error : Protocol not supportederrno : 94 , error : Socket type not supportederrno : 95 , error : Operation not supportederrno : 96 , error : Protocol family not supportederrno : 97 , error : Address family not supported by protocolerrno : 98 , error : Address already in useerrno : 99 , error : Cannot assign requested addresserrno : 100 , error : Network is downerrno : 101 , error : Network is unreachableerrno : 102 , error : Network dropped connection on reseterrno : 103 , error : Software caused connection aborterrno : 104 , error : Connection reset by peererrno : 105 , error : No buffer space availableerrno : 106 , error : Transport endpoint is already connectederrno : 107 , error : Transport endpoint is not connectederrno : 108 , error : Cannot send after transport endpoint shutdownerrno : 109 , error : Too many references: cannot spliceerrno : 110 , error : Connection timed outerrno : 111 , error : Connection refusederrno : 112 , error : Host is downerrno : 113 , error : No route to hosterrno : 114 , error : Operation already in progresserrno : 115 , error : Operation now in progresserrno : 116 , error : Stale file handleerrno : 117 , error : Structure needs cleaningerrno : 118 , error : Not a XENIX named type fileerrno : 119 , error : No XENIX semaphores availableerrno : 120 , error : Is a named type fileerrno : 121 , error : Remote I/O errorerrno : 122 , error : Disk quota exceedederrno : 123 , error : No medium founderrno : 124 , error : Wrong medium typeerrno : 125 , error : Operation cancelederrno : 126 , error : Required key not availableerrno : 127 , error : Key has expirederrno : 128 , error : Key has been revokederrno : 129 , error : Key was rejected by serviceerrno : 130 , error : Owner diederrno : 131 , error : State not recoverableerrno : 132 , error : Operation not possible due to RF-killerrno : 133 , error : Unknown error 133..
.
errno : 255 , error : Unknown error 255
当errno到达134的时候就没有错误了~