This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: kill(pid, 0) issue


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]