delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/02/20/09:52:04

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: signal handler and JNI
Date: Mon, 20 Feb 2006 14:51:51 -0000
Message-ID: <004c01c6362d$2f2219b0$a501a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
In-Reply-To: <43F9D317.5090502@alexdupre.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 20 February 2006 14:33, Alex Dupre wrote:

> Hello,
> I have a question about signal handling and JNI under cygwin.
> 
> The scenario is the following:
> - a cygwin program register a function to handle SIGINT and SIGTERM signals
> - the program then launches the Java Virtual Machine via the JNI
> invocation API, telling it to not override any signal handlers
> 
> Hitting a CTRL-C should then immediately run the defined signal handler,
> but this is not the case. For some reason (what exactly?) inside the
> java program I need to periodically call a native function linked with
> cygwin, but this is not enough. In the called function I have to do
> something more, like printing a char to stdout or /dev/null (calling
> printf("") with an empty string doesn't work). Only in this way the
> signal handler is called as soon as I hit CTRL-C, otherwise it's ignored
> or handled seconds/minutes later.
> Maybe the callback to C code is mandatory under cygwin, but why should I
> print something to have to signal handled? Any suggestions?
> 
> --
> Alex Dupre


  Well, have you read the internals doc about how signals work?

http://cygwin.com/cgi-bin/cvsweb.cgi/~checkout~/src/winsup/cygwin/how-signals-
work.txt?rev=1.14&content-type=text/plain&cvsroot=src



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019