delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/26/09:32:02

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <d37422b50806260631kd709a1cm64e67bec827ac32f@mail.gmail.com>
Date: Thu, 26 Jun 2008 16:31:20 +0300
From: "Borislav Ivanov" <borislav DOT g DOT ivanov AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Get the cygwin PID of a Win PID
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019