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 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: Re Re: Is there a translation from windows events to cygwin signals ? Date: Tue, 3 Feb 2004 17:31:23 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: =?iso-8859-1?Q?Lutz_H=F6rl?= To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i13GVixM013997 -----Ursprüngliche Nachricht----- Von: Igor Pechtchanski [mailto:pechtcha AT cs DOT nyu DOT edu] Gesendet: Dienstag, 3. Februar 2004 16:55 An: Lutz Hörl Cc: cygwin AT cygwin DOT com Betreff: Re: Is there a translation from windows events to cygwin signals ? On Tue, 3 Feb 2004, Lutz Hörl wrote: > Hello, > > My problem: > > I have to send a signal to a running cygwin application, but I can not > use the cygwin API for this purpose. This doesn't make sense. You can always do system("c:/cygwin/bin/kill -HUP "). > This signal (e.g. SIGHUP) can be cought by my cywin application, the > application can react on it in a proper way. > > Until now I found only documentation that states that the cygwin > signals rely on windows events but no documentation on how to use this > mechanism. > > Is there a 'translation' from windows events into signals ? Is there a > way to use then Win32 "BroadcastSystemMessage()" function to send a > Signal to cygwin application ? > > Thank you all > Lutz Hoerl Cygwin signals use Windows events under the covers, but there's more to Cygwin signals than just Windows events. There's no one-to-one mapping. Use "kill". Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton ----------------------------- Thank you Igor! I know it sounds ugly, but let me go a little more into detail. I want to do the following: Start a native Win32 application, let us call it the 'frontend'. This frontend starts and stops some cygwin applications. Start is no problem, I can do this with the Win32's CreateProcess() function. Therefrom I get the applications HANDLE. For stopping the application I want to use this HANDLE but I do not want to use the Win32's TerminateProcess() function to stop the process because that gives the (cygwin-) applications no time to save anything. That is the reason why I am looking for a SIGNAL-sending capability from Win32 applications. When I listen to your answer I can imagine what to do in my Win32 App.: 1. start the cygwin application via CreateProcess(), get a HANDLE 2. obtain the process' Win32-PID from the obtain HANDLE 3. use the cygwin win_pid to cygwin_pid function 4. use the cygwin kill() function with this pid to send a signal to the cygwin application 5. wait for the cygwin application to exit That means to compile the Win32 application with a DLL that does steps 2 to 5. Can you confirm that this is the way ? I would be happy to read about a shorter way. Thank you again Lutz Hoerl Thorlabs GmbH Gauss-Strasse 11 D-85757 Karlsfeld Germany Tel. +49 (0)8131 5956 44 FAX +49 (0)8131 5956 99 Mail lhoerl AT thorlabs DOT com -- 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/