I have an assignment in which I have to create a mini shell which is capable of doing a lot of things including job control. I managed to create new jobs using fork and execvp.
If you don't do anything special the parent receives a SIGCHLD
when the child dies. Careful though, multiple children can terminate at the same time and you'll get a single signal. The correct way to handle this is to loop (in the signal handler):
while (waitpid(-1, NULL, WNOHANG) > 0)
/* Stuff. */