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, 15 Sep 2005 08:14:40 -0700 (PDT) From: Eduardo Chappa To: cygwin AT cygwin DOT com Subject: problem with getppid() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Antivirus: Scanned by Vexira Antivirus 1.1.1 X-IsSubscribed: yes Hello, I have a problem runing the following program "test.c" ------ #include #include #include main() { int p; if((p = getppid()) == 1) printf("My parent is bad, ppid=%d\n", p); else printf("My parent is good, ppid=%d\n", p); exit(0); } -------- I build the program with the command gcc -g -o test test.c The problem is the following. When I execute the program in the command line ./test I get the output: "My parent is good", but if I execute the same program under gdb gdb ./test (gdb) run The output is "My parent is bad". I believe this is a bug in Cygwin's implementation of getppid(). Could someone please confirm this. Hopefully it is easy to fix. Thank you. -- 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/