In my simple custom shell I\'m reading commands from the standard input and execute them with execvp(). Before this, I create a fork of the current process and I call the ex
Use wait() or waitpid() in the parent process. An example here: Return code when OS kills your process.
wait()
waitpid()
Also, when a child dies the SIGCHLD signal is sent to the parent process.
SIGCHLD