you said that the parent process returns 0. so wouldn't it be: if (fork()) { //child } else { //parent }
Thanks, Tyler Littlefield Web: tysdomain.com email: ty...@tysdomain.com My programs don't have bugs, they're called randomly added features. ----- Original Message ----- From: Thomas Hruska To: c-prog@yahoogroups.com Sent: Wednesday, April 08, 2009 6:55 AM Subject: Re: [c-prog] C language Tyler Littlefield wrote: > got it, thanks. so the fork just starts on the line after fork for the child process? > > Thanks, > Tyler Littlefield > Web: tysdomain.com > email: ty...@tysdomain.com > My programs don't have bugs, they're called randomly added features. No, it starts on the same line. The return value is typically used in the 'if' statement that fork() is a part of. if (fork()) { // Parent process. } else { // Child process. } -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/ [Non-text portions of this message have been removed]