Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 18 Dec 2003 10:27:39 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: kill(pid, 0) issue Message-ID: <20031218152739.GA3888@redhat.com> Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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. > >Thanks for a reply. I have run your test case and it really works. So >then I have modified it slightly to make it similar to what my >application is doing. Now it reproduces the behaviour of my app. I'm >running this test below in a Windows console and using Cygwin console >to display processes issuing 'ps' command. I have expected the child >process to be finished after some time(when main process is blocked on >'getc()') but kill(pid, 0) returns 0. > >Probably there is an issue lying beneath I'm not aware of. As I said in my response to you, you DO have to wait for a pid if you want kill(pid, 0) to return -1. I'm not sure why you are sending a test case which illustrates exactly what I told you the problem is. Apparently you didn't read the part that I quoted above. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/