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 Message-ID: <55E0A3E94323974F83CFC5AAB96F68B801419715@snnexc03.in.ce.com.au> From: Sonam Chauhan To: "'Reini Urban'" Cc: "'cygwin AT cygwin DOT com'" Subject: RE: problems in Perl process management Date: Wed, 18 May 2005 13:01:48 +1000 MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Reini: [Note, I'm no Cygwin expert, so please correct any misunderstandings.] > >>or fix it in this module XS. It's really easy with the cygwin provided > >>translation functions. > >> See http://sourceware.org/ml/cygwin/2005-02/msg00154.html ... > > After all, Proc::ProcessTable misreports the PID and > > PPID only under certain conditions -- this would indicate a complex > issue in > > Proc::ProcessTable XS code, right? > > No. Just the translation is needed, but one has to specify somehow which > pid's he wants. The cygwin pid's or the winpid's. > Both have their merits and usecases. Why are two usecases needed? The code that builds the process table (returned by Proc::ProcessTable->table) should return the same PID and PPID that 'ps' reports - no exceptions - right? I had a look in Proc::ProcessTable's .xs and os/cygwin.c. There seem to be a problem with the process table data returned by this code in the OS_get_table() function: This defines an internal Cygwin query to return process information: cygwin_getinfo_types query = CW_GETPINFO_FULL; This executes the query within a for loop: p = (external_pinfo *) cygwin_internal (query, pid | CW_NEXTPID); From what I gather, the root problem is that for some processes (as demonstrated by my testcase script), the CW_GETPINFO_FULL query returns: 1. Invalid PPIDs 2. WINPID instead of Cygwin PID. How will the translation functions you mentioned solve these two problems? Cheers, Sonam -- 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/