Newbie to Forking here...
I need to create a simple program that runs on Linux (Fedora Core 2, to be exact) that has a parent process that spawns 9 child processes. The child processes need to hang around for about 10 seconds or so (long enough to see all of the processes running when you type "ps" command). Then, the child processes need to die and then finally the parent. (So tragic!)
I thought that putting the fork calls inside of a FOR loop would do it for me, but it doesn't. A whole lot more than 9 child processes are being created. The code is below...what am I doing wrong???
Thanks in advance...
I need to create a simple program that runs on Linux (Fedora Core 2, to be exact) that has a parent process that spawns 9 child processes. The child processes need to hang around for about 10 seconds or so (long enough to see all of the processes running when you type "ps" command). Then, the child processes need to die and then finally the parent. (So tragic!)
I thought that putting the fork calls inside of a FOR loop would do it for me, but it doesn't. A whole lot more than 9 child processes are being created. The code is below...what am I doing wrong???
Thanks in advance...