Re: kill(pid, 0) issue

2003-12-18 Thread Brian Dessent
Nowakowski Maciej-AMN011 wrote: > //int dummy; > //wait (&dummy); > getc(stdin); > } > printf ("%d = kill (%d, 0)\n", kill (pid, 0), pid); When the child process terminates its in a zombie state until its parent reaps it by calling wait. Thus a call to kill will return su

RE: kill(pid, 0) issue

2003-12-18 Thread Nowakowski Maciej-AMN011
Yes you are right I somehow missed the sentence: >>kill(pid, 0) will succeed on both linux and >>cygwin if the process is not reaped by calling wait (or waitpid, etc.) >>first. Thanks, Maciek -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygw

Re: kill(pid, 0) issue

2003-12-18 Thread Christopher Faylor
On Thu, Dec 18, 2003 at 10:34:12AM +0100, Nowakowski Maciej-AMN011 wrote: >>I suspect that you are not 'wait()'ing for the process to exit before >>checking if it exists. kill(pid, 0) will succeed on both linux and >>cygwin if the process is not reaped by calling wait (or waitpid, etc.) >>first. >

RE: kill(pid, 0) issue

2003-12-18 Thread Nowakowski Maciej-AMN011
> -Original Message- > From: Christopher Faylor > Sent: Wednesday, December 17, 2003 6:27 PM > To: [EMAIL PROTECTED] > Subject: Re: kill(pid, 0) issue > > > On Wed, Dec 17, 2003 at 05:23:20PM +0100, Nowakowski > Maciej-AMN011 wrote: > >My application

Re: kill(pid, 0) issue

2003-12-17 Thread Christopher Faylor
On Wed, Dec 17, 2003 at 05:23:20PM +0100, Nowakowski Maciej-AMN011 wrote: >My application creates additional process using fork() function. >Created child process listens on a socket and exits when it receives >anything. The main process checks the child PID using kill(pid, 0) >with child PID as a

kill(pid, 0) issue

2003-12-17 Thread Nowakowski Maciej-AMN011
Hi all, My application creates additional process using fork() function. Created child process listens on a socket and exits when it receives anything. The main process checks the child PID using kill(pid, 0) with child PID as a parameter. Even when the child has exited this function call retur