This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: howto register process


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]