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: SIGKILL and TerminateProcess


On 10/29/2013 3:21 PM, Christopher Faylor wrote:
On Tue, Oct 29, 2013 at 06:37:46PM +0000, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
CYGWIN lets me access some Windows-specific APIs (the same way one
would do by using some UNIX-flavor-specific libraries), without having
to port them all to CYGWIN first.  Such code becomes a real problem in
pipelining because it cannot be reliably managed from other processes
(which would all require modifications to do TerminateProcess tricks
throughout; or use the special CYGWIN command-like utility) where just
kill(9) would have been sufficient..

To be a broken record: The whole point of Cygwin is to run UNIX based
programs on Windows.  Asking for the addition of special-case code so
that people can use Windows functions in their programs completely
misses the point of this project.

That said, however, the Cygwin "kill" command does have a "-f" option
which forces the termination of a process if it can't be killed with
Cygwin's signal mechanism (I added it so that I could kill processes
that were hung while I was working on Cygwin's signal code).  If it is
essential that you be able to summarily terminate Windows programs then
use that.

What cgf said. However, there is a "cygwin" API you could add, which allows to programatically do "TerminateProcess" the "correct way" so that (cygwin) pipelines and such Do The Right Thing:

http://cygwin.com/ml/cygwin-patches/2009-q4/msg00028.html

Don't know if this will help in your situation, but I figured it should be mentioned.

--
Chuck


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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