X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: Date: Thu, 26 Jun 2008 16:31:20 +0300 From: "Borislav Ivanov" To: cygwin AT cygwin DOT com Subject: Get the cygwin PID of a Win PID MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hello, I'm currently updating cygwin from 1.3.22 to 1.5.25 and I encountered a problem with Winpids/Cygwinpids. I have a custom tool that checks if a process is running by invoking kill(PID, 0). The PID is retrieved from a PID file which all applications write on startup. On 1.3 I get this: d:\>ps -W | grep mysql 1860 0 0 1860 ? 0 15:54:44 c:\mysql\bin\mysqld-nt.exe and on 1.5 I get: D:\>ps -W | grep mysql 2744 1 1384 1980 ? 18 15:07:22 /drives/c/mysql/bin/mysqld-nt 1980 0 0 1980 ? 0 15:07:23 c:\mysql\bin\mysqld-nt.exe On both 1.3 and 1.5 my pid file contains the Winpid. The difference here is that on 1.3 kill(Winpid, 0) succeeds but on 1.5 fails with errno=ESRCH, while kill(Cygwinpid, 0) behaves as expected. I searched through the list, but found only transition from cygwinpid to winpid (by using winpid = cygwin_internal(CW_CYGWIN_PID_TO_WINPID, pid)). Is there some analogue to retrieve the corresponding cygwinpid of a winpid? Thank you, Borislav Ivanov -- 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/