Message-Id: <199903312046.UAA50148@out4.ibm.net> From: "Mark E." To: djgpp-workers AT delorie DOT com Date: Wed, 31 Mar 1999 15:46:55 -0500 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Bash ctrl-c problem simplified X-mailer: Pegasus Mail for Win32 (v3.01d) Reply-To: djgpp-workers AT delorie DOT com When I compile and execute this program, I get a traceback instead of what the documentation below (taken from signal) describes. Does the special SIGINT behavior only apply when the ctrl-c key is pressed or should it also apply to kill() generated interrupts? #include int main() { kill (getpid(), SIGINT); return 0; } Here's the relavant portion of libc.info from the signal function: The default handling for the rest of the signals is to print a traceback (a stack dump which describes the sequence of function calls leading to the generation of the signal) and abort the program by calling `_exit' (*note _exit::.). As an exception, the default handler for the signal `SIGINT' doesn't print the traceback, and calls `exit' instead of `_exit', when the INTR key (`Ctrl-C' by default) is pressed, so that programs could be shut down safely in this manner. What happens in Bash when ctrl-c is pressed is the SIGINT handler is called to do cleanup, it then resets the SIGINT handler to the default, then calls kill(). The default SIGINT handler then calls the traceback routine. I can probably fix this in Bash, but does libc's SIGINT handling need fixing too? --- Mark Elbrecht, snowball3 AT usa DOT net http://snowball.digitalspace.net/