|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!strerror()函数根据errno值前往毛病形貌字符串,上面步伐打印对比表:
<!C
CodehighlightingproducedbyActiproCodeHighlighter(freeware)
http://www.CodeHighlighter.com/
C>
01.#include<errno.h>
02.#include<string.h>
03.#include<stdio.h>
04.
05.intmain()
06.
{
07.inti;
08.for(i=0;i<140;++i)
09.
{
10.errno=i;
11.printf(“errno%d: %s
“,i,strerror(errno));
12.}
13.return0;
14.}
毛病对比表:
errno0:Success
errno1:Operationnotpermitted
errno2:Nosuchfileordirectory
errno3:Nosuchprocess
errno4:Interruptedsystemcall
errno5:Input/outputerror
errno6:Nosuchdeviceoraddress
errno7:Argumentlisttoolong
errno8:Execformaterror
errno9:Badfiledescriptor
errno10:Nochildprocesses
errno11:Resourcetemporarilyunavailable
errno12:Cannotallocatememory
errno13:Permissiondenied
errno14:Badaddress
errno15:Blockdevicerequired
errno16:Deviceorresourcebusy
errno17:Fileexists
errno18:Invalidcross-devicelink
errno19:Nosuchdevice
errno20:Notadirectory
errno21:Isadirectory
errno22:Invalidargument
errno23:Toomanyopenfilesinsystem
errno24:Toomanyopenfiles
errno25:Inappropriateioctlfordevice
errno26:Textfilebusy
errno27:Filetoolarge
errno28:Nospaceleftondevice
errno29:Illegalseek
errno30:Read-onlyfilesystem
errno31:Toomanylinks
errno32:Brokenpipe
errno33:Numericalargumentoutofdomain
errno34:Numericalresultoutofrange
errno35:Resourcedeadlockavoided
errno36:Filenametoolong
errno37:Nolocksavailable
errno38:Functionnotimplemented
errno39:Directorynotempty
errno40:Toomanylevelsofsymboliclinks
errno41:Unknownerror41
errno42:Nomessageofdesiredtype
errno43:Identifierremoved
errno44:Channelnumberoutofrange
errno45:Level2notsynchronized
errno46:Level3halted
errno47:Level3reset
errno48:Linknumberoutofrange
errno49:Protocoldrivernotattached
errno50:NoCSIstructureavailable
errno51:Level2halted
errno52:Invalidexchange
errno53:Invalidrequestdescriptor
errno54:Exchangefull
errno55:Noanode
errno56:Invalidrequestcode
errno57:Invalidslot
errno58:Unknownerror58
errno59:Badfontfileformat
errno60:Devicenotastream
errno61:Nodataavailable
errno62:Timerexpired
errno63:Outofstreamsresources
errno64:Machineisnotonthenetwork
errno65:Packagenotinstalled
errno66:Objectisremote
errno67:Linkhasbeensevered
errno68:Advertiseerror
errno69:Srmounterror
errno70:Communicationerroronsend
errno71:Protocolerror
errno72:Multihopattempted
errno73:RFSspecificerror
errno74:Badmessage
errno75:Valuetoolargefordefineddatatype
errno76:Namenotuniqueonnetwork
errno77:Filedescriptorinbadstate
errno78:Remoteaddresschanged
errno79:Cannotaccessaneededsharedlibrary
errno80:Accessingacorruptedsharedlibrary
errno81:.libsectionina.outcorrupted
errno82:Attemptingtolinkintoomanysharedlibraries
errno83:Cannotexecasharedlibrarydirectly
errno84:Invalidorincompletemultibyteorwidecharacter
errno85:Interruptedsystemcallshouldberestarted
errno86:Streamspipeerror
errno87:Toomanyusers
errno88:Socketoperationonnon-socket
errno89:Destinationaddressrequired
errno90:Messagetoolong
errno91:Protocolwrongtypeforsocket
errno92:Protocolnotavailable
errno93:Protocolnotsupported
errno94:Sockettypenotsupported
errno95:Operationnotsupported
errno96:Protocolfamilynotsupported
errno97:Addressfamilynotsupportedbyprotocol
errno98:Addressalreadyinuse
errno99:Cannotassignrequestedaddress
errno100:Networkisdown
errno101:Networkisunreachable
errno102:Networkdroppedconnectiononreset
errno103:Softwarecausedconnectionabort
errno104:Connectionresetbypeer
errno105:Nobufferspaceavailable
errno106:Transportendpointisalreadyconnected
errno107:Transportendpointisnotconnected
errno108:Cannotsendaftertransportendpointshutdown
errno109:Toomanyreferences:cannotsplice
errno110:Connectiontimedout
errno111:Connectionrefused
errno112:Hostisdown
errno113:Noroutetohost
errno114:Operationalreadyinprogress
errno115:Operationnowinprogress
errno116:StaleNFSfilehandle
errno117:Structureneedscleaning
errno118:NotaXENIXnamedtypefile
errno119:NoXENIXsemaphoresavailable
errno120:Isanamedtypefile
errno121:RemoteI/Oerror
errno122:Diskquotaexceeded
errno123:Nomediumfound
errno124:Wrongmediumtype
errno125:Operationcanceled
errno126:Requiredkeynotavailable
errno127:Keyhasexpired
errno128:Keyhasbeenrevoked
errno129:Keywasrejectedbyservice |
|