This is the mail archive of the
mailing list for the Cygwin project.
Control-C, SIGINT, ConsoleCtrlHandler...
- From: Timothy Wall <twall at oculustech dot com>
- To: cygwin at cygwin dot com
- Date: Tue, 08 Jan 2002 12:31:47 -0500
- Subject: Control-C, SIGINT, ConsoleCtrlHandler...
- Organization: Oculus Technologies
- Reply-to: twall at oculustech dot com
I'm trying to get some consistent behavior under the command shell and cygwin,
tho' without much luck so far. I'd like to know if there's a canonical
SIGINT/SIGTERM handling convention for console processes (taking cygwin into
account, or barring that for invocations in cmd.exe only).
The important thing for my program is that it perform certain cleanup
operations on exit (normally taken care of with a signal handler attached to
Under the cmd.exe, the handler usually gets called when it's installed with
signal() or with SetConsoleCtrlHandler (there have been cases where it does
not, but I can't reliably reproduce them...).
Under bash, however, it looks like the consolectrlhandler never even gets a
chance to finish before the process is wiped. Installing with signal() also
seems that the process is wiped before the cleanup gets a chance to run.
(the handler sets a flag which the main thread uses to determine that it's
time to exit).
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html