From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Problems stopping simulations in emacs shells Date: Tue, 12 Jul 2005 21:44:50 +0200 Organization: [posted via Easynet Spain] Message-ID: <87k6jvg66l.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1121197751 30859 80.91.229.2 (12 Jul 2005 19:49:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jul 2005 19:49:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 12 21:49:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DsQk6-0005AT-Ut for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jul 2005 21:48:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DsQlk-0006VT-PW for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Jul 2005 15:50:16 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!colt.net!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:p1S397J6R33DD4//AYcUOWcWRH0= Original-Lines: 33 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=ON=]?a1ml5`E`TXNcFMmj`EY<>`XO4V7m>Uh List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27904 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27904 david@adboyd.com (J. David Boyd) writes: > And sometimes I've found that I need to hit Ctrl-C many times to get out of a > job running in a shell. Must be something that is timing dependent. Not exactly. C-c is usually bound to SIGINT in the shells. That is, when you type C-c, the terminal driver sends the INT signal to the process controling the terminal. The process can handle any and all signals, but KILL, as it wishes. For most signals, if nothing is done by the process, the default is to kill the process. But a program can set a signal handler for the INT signal and do whatever it please it. Honest programs try to flush their buffers and close their files and exit promptly. However, if they hang (infinite loop or waiting for I/O or just take more than a few seconds to be noticed by the user), while doing, the user will be unhappy and will type C-c C-c C-c, etc sending a useless sequence of INT signals. If the process is not waiting in the kernel doing I/O ('D' state in ps), then it can be forcybly terminated immediately with the KILL signal: kill -KILL $PID But really, you should be patient and let the process close its file if you don't want to lose data, unless you know the process is bugged and not doing what it should. -- __Pascal Bourguignon__ http://www.informatimago.com/ This is a signature virus. Add me to your signature and help me to live