Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process Exit Code When Process is Killed Forcibly

When we kill a process in Windows with Task Manager End Process command, will the process still return an exit code? And if so, what exit code it returns? Thanks

like image 209
Armen Tsirunyan Avatar asked Dec 03 '10 11:12

Armen Tsirunyan


People also ask

What is the exit code of a killed process?

137 = killed by SIGKILL Exit code 137 is Linux-specific and means that your process was killed by a signal, namely SIGKILL .

What is process exit code 1?

Exit Code 1 indicates that a container shut down, either because of an application failure or because the image pointed to an invalid file. In a Unix/Linux operating system, when an application terminates with Exit Code 1, the operating system ends the process using Signal 7, known as SIGHUP.

Does exit kill the process?

exit() closes all files and sockets, frees all memory and then terminates the process.


1 Answers

In general, a process is terminated using TerminateProcess. The exit code is passed as a parameter to this method.

In the case of the task manager, the exit code is set to 1, but I don't know if it's documented anywhere.

like image 171
Simon Mourier Avatar answered Oct 22 '22 22:10

Simon Mourier