delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/08/12:47:48

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 8 Jan 2002 12:47:37 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Cc: twall AT oculustech DOT com
Subject: Re: Control-C, SIGINT, ConsoleCtrlHandler...
Message-ID: <20020108174737.GC24431@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, twall AT oculustech DOT com
References: <3C3B2D03 DOT F0C73746 AT oculustech DOT com>
Mime-Version: 1.0
In-Reply-To: <3C3B2D03.F0C73746@oculustech.com>
User-Agent: Mutt/1.3.23.1i

If you are writing cygwin programs, don't use windows signal mechanisms
like SetConsoleCtrlHandler.  Just use signal()/kill(), et al.

If your program does not use cygwin then investigate the currently active
thread "bash/cmd CTRL-C problem...".

cgf

On Tue, Jan 08, 2002 at 12:31:47PM -0500, Timothy Wall wrote:
>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
>SIGINT/SIGTERM).
>
>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
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