This is the mail archive of the cygwin 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: problem with getppid()


*** Corinna Vinschen (pcorinna-cygwin@cygwin.cometh) wrote in the cygwin...:

:) > The output is "My parent is bad". I believe this is a bug in Cygwin's 
:) > implementation of getppid().
:) 
:) No, it's not a bug.  GDB starts the inferior process using the standard 
:) Windows mechanisms since it should be useful also for native debugging. 
:) When the inferior process is not started by Cygwin's own fork/exec 
:) process, the child process doesn't know anything about its parent 
:) process, at least not on Windows 9x.  There's a way to retrieve the 
:) native parent PID by using NtQueryInformationProcess on NT, but it 
:) doesn't seem very useful to get this information.

Dear Corinna,

  Thank you for your fast response. Now I understand the issue that is 
involved. I have had this problem runing Pine in Cygwin. I've tried this 
in Windows 2000 Pro and Windows XP Pro. The same issue is not present in 
Linux, where I get the "expected" behavior. The manual of getppid makes me 
believe that the correct behavior for getppid is to return gdb's pid in 
the "bad" behavior, and since it is documented that getppid is supported 
in Cygwin, I would expect it to behave that way.

  The problem I have is that when Pine gets ppid == 1 it exits, and this 
is checked after a timeout for a select() command, which makes it very 
hard to debug pine under gdb. It would be great if I did not have to 
modify the source code of Pine to get around this problem. I can work 
around this at this moment, but I'd rather not have to modify Pine to work 
around this.

  From your response it seems that you are not willing to "fix" this 
problem. If that is the case, simply confirm this, and I will understand, 
otherwise it would be great if this were corrected in a future release and 
I would appreciate this a lot.

  Thank you for your consideration!

-- 
Eduardo
http://www.math.washington.edu/~chappa/pine/

--
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]