Workflow Tools Control Yard

Home / Linux

Linux exit code, signal and errno lookup

Type an exit code such as 137, a signal such as 9 or SIGSEGV, or an errno value such as 111 or ECONNREFUSED, or paste the line that holds one. The page says what the number means as an exit status, as a signal and as an errno value, and which of them the line points to. It reads the text in your browser.

What an exit status says

A process ends with a number from 0 to 255 for the program that started it: zero means success and anything else means failure. A shell keeps the number of the last command in $?. Bash gives some numbers a meaning of its own:

Exit statusWhat it means
0Success.
1 to 125The program's own failure codes: its documentation says what each means.
2For a Bash builtin: it was used wrongly, such as with an option it does not know or a missing argument.
126The command was found but is not executable, such as a file without execute permission.
127The command was not found: a typing mistake, or a program that is not installed or not in PATH.
128 + NThe process was ended by signal N: 137 is 128 + 9 (SIGKILL), 139 is 128 + 11 (SIGSEGV), 143 is 128 + 15 (SIGTERM).

Only the lowest 8 bits of the number the program gives reach the program that waits for it, so exit 256 reports 0 and exit -1 reports 255.

Signals

The numbers of x86 and ARM Linux, with the exit status Bash reports when a signal ends a command, the GNU C Library's text for the signal and what the signal does when the program sets nothing else. SIGKILL and SIGSTOP cannot be caught, blocked or ignored. Pressing Ctrl+C in a terminal sends SIGINT, and the kernel's out-of-memory killer ends a process with SIGKILL. Some other processors, such as MIPS, Alpha and SPARC, number some signals differently.

SignalNameExit statusTextDefault action
1SIGHUP129HangupEnds the process
2SIGINT130InterruptEnds the process
3SIGQUIT131QuitEnds the process and writes a core dump
4SIGILL132Illegal instructionEnds the process and writes a core dump
5SIGTRAP133Trace/breakpoint trapEnds the process and writes a core dump
6SIGABRT SIGIOT134AbortedEnds the process and writes a core dump
7SIGBUS135Bus errorEnds the process and writes a core dump
8SIGFPE136Floating point exceptionEnds the process and writes a core dump
9SIGKILL137KilledEnds the process
10SIGUSR1138User defined signal 1Ends the process
11SIGSEGV139Segmentation faultEnds the process and writes a core dump
12SIGUSR2140User defined signal 2Ends the process
13SIGPIPE141Broken pipeEnds the process
14SIGALRM142Alarm clockEnds the process
15SIGTERM143TerminatedEnds the process
16SIGSTKFLT144Stack faultEnds the process
17SIGCHLD145Child exitedIgnored
18SIGCONT146ContinuedContinues a stopped process
19SIGSTOP147Stopped (signal)Stops (pauses) the process
20SIGTSTP148StoppedStops (pauses) the process
21SIGTTIN149Stopped (tty input)Stops (pauses) the process
22SIGTTOU150Stopped (tty output)Stops (pauses) the process
23SIGURG151Urgent I/O conditionIgnored
24SIGXCPU152CPU time limit exceededEnds the process and writes a core dump
25SIGXFSZ153File size limit exceededEnds the process and writes a core dump
26SIGVTALRM154Virtual timer expiredEnds the process
27SIGPROF155Profiling timer expiredEnds the process
28SIGWINCH156Window changedIgnored
29SIGIO SIGLOST SIGPOLL157I/O possibleEnds the process
30SIGPWR158Power failureEnds the process
31SIGSYS SIGUNUSED159Bad system callEnds the process and writes a core dump

Real-time signals are 32 to 64 in the kernel. The GNU C Library keeps the first two or three for itself, so programs see SIGRTMIN as 34 or 35; a command ended by one reports 160 to 192.

errno values

When a system call fails, it sets errno to one of these numbers, and programs print the text that goes with it, such as connect: Connection refused. The numbers are those of x86 and ARM Linux, and the texts are the GNU C Library's. 41 and 58 are not used.

NumberNameText
1EPERMOperation not permitted
2ENOENTNo such file or directory
3ESRCHNo such process
4EINTRInterrupted system call
5EIOInput/output error
6ENXIONo such device or address
7E2BIGArgument list too long
8ENOEXECExec format error
9EBADFBad file descriptor
10ECHILDNo child processes
11EAGAIN EWOULDBLOCKResource temporarily unavailable
12ENOMEMCannot allocate memory
13EACCESPermission denied
14EFAULTBad address
15ENOTBLKBlock device required
16EBUSYDevice or resource busy
17EEXISTFile exists
18EXDEVInvalid cross-device link
19ENODEVNo such device
20ENOTDIRNot a directory
21EISDIRIs a directory
22EINVALInvalid argument
23ENFILEToo many open files in system
24EMFILEToo many open files
25ENOTTYInappropriate ioctl for device
26ETXTBSYText file busy
27EFBIGFile too large
28ENOSPCNo space left on device
29ESPIPEIllegal seek
30EROFSRead-only file system
31EMLINKToo many links
32EPIPEBroken pipe
33EDOMNumerical argument out of domain
34ERANGENumerical result out of range
35EDEADLK EDEADLOCKResource deadlock avoided
36ENAMETOOLONGFile name too long
37ENOLCKNo locks available
38ENOSYSFunction not implemented
39ENOTEMPTYDirectory not empty
40ELOOPToo many levels of symbolic links
42ENOMSGNo message of desired type
43EIDRMIdentifier removed
44ECHRNGChannel number out of range
45EL2NSYNCLevel 2 not synchronized
46EL3HLTLevel 3 halted
47EL3RSTLevel 3 reset
48ELNRNGLink number out of range
49EUNATCHProtocol driver not attached
50ENOCSINo CSI structure available
51EL2HLTLevel 2 halted
52EBADEInvalid exchange
53EBADRInvalid request descriptor
54EXFULLExchange full
55ENOANONo anode
56EBADRQCInvalid request code
57EBADSLTInvalid slot
59EBFONTBad font file format
60ENOSTRDevice not a stream
61ENODATANo data available
62ETIMETimer expired
63ENOSROut of streams resources
64ENONETMachine is not on the network
65ENOPKGPackage not installed
66EREMOTEObject is remote
67ENOLINKLink has been severed
68EADVAdvertise error
69ESRMNTSrmount error
70ECOMMCommunication error on send
71EPROTOProtocol error
72EMULTIHOPMultihop attempted
73EDOTDOTRFS specific error
74EBADMSG EFSBADCRCBad message
75EOVERFLOWValue too large for defined data type
76ENOTUNIQName not unique on network
77EBADFDFile descriptor in bad state
78EREMCHGRemote address changed
79ELIBACCCan not access a needed shared library
80ELIBBADAccessing a corrupted shared library
81ELIBSCN.lib section in a.out corrupted
82ELIBMAXAttempting to link in too many shared libraries
83ELIBEXECCannot exec a shared library directly
84EILSEQInvalid or incomplete multibyte or wide character
85ERESTARTInterrupted system call should be restarted
86ESTRPIPEStreams pipe error
87EUSERSToo many users
88ENOTSOCKSocket operation on non-socket
89EDESTADDRREQDestination address required
90EMSGSIZEMessage too long
91EPROTOTYPEProtocol wrong type for socket
92ENOPROTOOPTProtocol not available
93EPROTONOSUPPORTProtocol not supported
94ESOCKTNOSUPPORTSocket type not supported
95EOPNOTSUPPOperation not supported
96EPFNOSUPPORTProtocol family not supported
97EAFNOSUPPORTAddress family not supported by protocol
98EADDRINUSEAddress already in use
99EADDRNOTAVAILCannot assign requested address
100ENETDOWNNetwork is down
101ENETUNREACHNetwork is unreachable
102ENETRESETNetwork dropped connection on reset
103ECONNABORTEDSoftware caused connection abort
104ECONNRESETConnection reset by peer
105ENOBUFSNo buffer space available
106EISCONNTransport endpoint is already connected
107ENOTCONNTransport endpoint is not connected
108ESHUTDOWNCannot send after transport endpoint shutdown
109ETOOMANYREFSToo many references: cannot splice
110ETIMEDOUTConnection timed out
111ECONNREFUSEDConnection refused
112EHOSTDOWNHost is down
113EHOSTUNREACHNo route to host
114EALREADYOperation already in progress
115EINPROGRESSOperation now in progress
116ESTALEStale file handle
117EUCLEAN EFSCORRUPTEDStructure needs cleaning
118ENOTNAMNot a XENIX named type file
119ENAVAILNo XENIX semaphores available
120EISNAMIs a named type file
121EREMOTEIORemote I/O error
122EDQUOTDisk quota exceeded
123ENOMEDIUMNo medium found
124EMEDIUMTYPEWrong medium type
125ECANCELEDOperation canceled
126ENOKEYRequired key not available
127EKEYEXPIREDKey has expired
128EKEYREVOKEDKey has been revoked
129EKEYREJECTEDKey was rejected by service
130EOWNERDEADOwner died
131ENOTRECOVERABLEState not recoverable
132ERFKILLOperation not possible due to RF-kill
133EHWPOISONMemory page has hardware error
134EFTYPEInappropriate file type or format

The ones people meet most

NameWhat it usually means
EPERMThe operation needs a privilege the process does not have, whatever the file's permissions say.
ENOENTA file or folder in the path does not exist.
EACCESThe permissions of a file or folder in the path do not allow it.
ENOSPCThe file system or device is full.
EADDRINUSEAnother socket already uses that local address and port.
ECONNRESETThe other end reset the connection.
ETIMEDOUTThe connection attempt timed out: nothing answered in time. connect(2) adds that the server may be too busy to accept new connections.
ECONNREFUSEDNothing listens on that address and port: connect(2) says the connect found no one listening on the remote address.
EHOSTUNREACHNo route to the host.
ENETUNREACHThe network is unreachable from here.

Sources

More Linux tools