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 From: "Dave Korn" To: Subject: RE: howto register process Date: Fri, 12 Nov 2004 13:53:35 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <873bzfdyvh.fsf@zlatenlist.homelinux.net> Message-ID: X-OriginalArrivalTime: 12 Nov 2004 13:53:35.0125 (UTC) FILETIME=[00D16C50:01C4C8BF] > -----Original Message----- > From: cygwin-owner On Behalf Of Kamen TOMOV > Sent: 12 November 2004 12:40 > On Fri, Nov 12 2004, Brian Dessent wrote: > > > Kamen TOMOV wrote: > > > > > The parent process is started as a windows server. Then it > > > executes cygwin's fork. When I try to kill any of these with > > > kill() it returns "No such pid". > > > > Are you sure you're not confusing Cygwin PIDs with Win32 PIDs? In > > order to make the fork() magic work, Cygwin maintains its own PIDs > > in parallel to the actual windows PID. All the Cygwin functions > > ... > > Thanks Brian. Yes I am sure I'm not confusing them. I tryed a function > that is part of the cygwin's API. It is called cygwin_winpid_to_pid to > get the cygwin's PID but it returns -1 on pids which does not > correspond to a cygwin pid. Waittaminnit. You're saying that the spawned processes _aren't_ cygwin processes? Well then you're entirely barking up the wrong tree. Cygwin can't magically make win32 programs signal-aware. The issue of not having a pid for it is utterly irrelevant. OTOH, I think if you were to spawn them under a shell, rather than by fork-and-exec, you would probably be able to kill the children by killing the shell, in much the same way as if you're running in bash and you run cmd.exe at the command line you can then kill it and return to the shell by pressing ctrl-c. Which doesn't usually kill cmd.exe, but when it's launched as a child of a cygwin shell, works fine. cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/