Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A22DB61.25D2CECB@sattel.com> Date: Mon, 27 Nov 2000 14:08:33 -0800 From: Bruce Edge Organization: Sattel Global Networks X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.15-4mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: cygwin support Subject: Catching SIGINT problem Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I can't seem to trap a Ctrl-C in my app. I use the following code to trap all signals I'm interested in: sigemptyset( &SignalSet ); for ( int s = _SIGMIN; s < _SIGMAX; s++ ) { if ( ( s != SIGFPE ) && ( s != SIGKILL ) && ( s != SIGSTOP ) && ( s != SIGCONT ) && ( s != SIGTERM ) ) { sigaddset( &SignalSet, s ); if ( signal( s, lcbd_SigHandler ) == SIG_ERR ) { syslog( LOG_CRIT, "sigaddset failed, sig %d, %s", s, strerror( errno ) ); exit(-1); } } } And then use the following handler: void lcbd_SigHandler( int signo ) { ReceivedSignal = 1<