www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/11/13:25:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
To: cygwin AT cygwin DOT com
From: Kamen TOMOV <kamen AT cybuild DOT com>
Subject: Re: howto register process
Date: 11 Nov 2004 20:24:30 +0200
Organization: CYBUILD
Lines: 44
Message-ID: <87vfccw8f5.fsf@zlatenlist.homelinux.net>
References: <87mzxoveei DOT fsf AT zlatenlist DOT homelinux DOT net> <NUTMEGadVe5HXC9xubf00000688 AT NUTMEG DOT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: 212-104-100-183.cable.evrocom.net
X-Home-Page: http://www.cybuild.com
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
X-IsSubscribed: yes

On Thu, Nov 11 2004, Dave Korn wrote:

> > From: cygwin-owner On Behalf Of Kamen TOMOV
> > Sent: 11 November 2004 11:01
> > To: cygwin
> > Subject: howto register process
> > 
> > Hi,
> > 
> > I have an application that is created to work on Unix but it is
> > supposed to run on Windows as well. The problem is that we have a
> > daemon that spawns a few children and later it needs to kill
> > them. The parent process is supposed to communicate with its
> > children by signals and to eventually terminate them. I would like
> > to use kill(pid, signal) to kill the processes because they rely
> > on the signals mechanizm.
> > 
> > The problem is that kill returns "not such pid". Is there a way to
> > register a process in the cygwin process table so that later be
> > able to kill it with kill()? TIA.
> 
>   You can't kill a windows process with cygwin kill.  Presumably
> your software is using the windows native functions to spawn child
> processes?  That's not necessary: cygwin gives you unix syscalls on
> windows.  If you used the standard posix functions (fork/exec/etc)
> to start the children, kill would work fine on them, and you'd have
> a lot more common code and a lot less differences to keep track of
> between your unix and 'doze versions of your code.
> 
>     cheers, 
>       DaveK
> -- 
> Can't think of a witty .sigline today....

Thanks Dave. The thing is that the child processes get forked with a
fork() invocation. What's more not only the child pids are invisible
to cygwin, but also their parent is invisible. That is why I'm
wondering isn't there a way to make them part of the processes that
are visible by cygwin. My purpose is - to be able to kill them with
kill() and to use the signal system.

Regards,
-- 
Kamen TOMOV


--
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