How do I stop child processes from becoming defunct?
I'm writing a shell and by now it works pretty well, even though I still haven't managed to incorporate ncurses/termios yet. But when I run a program from my shell using "&", and shutdown the program, the child process becomes defunct.
As I understand it I need to handle the child process ending in some way, but how do I handle it without waiting for it? Or do I need two child processes, where the first starts the second and then waits for it, or would that just make the first child process defunct instead of the second?