From owner-freebsd-questions@FreeBSD.ORG Tue Jun 9 21:42:24 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BF52106568D for ; Tue, 9 Jun 2009 21:42:24 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5E38FC28 for ; Tue, 9 Jun 2009 21:42:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-195-65-8.dynamic.qsc.de [92.195.65.8]) by mx01.qsc.de (Postfix) with ESMTP id 121B93CC96; Tue, 9 Jun 2009 23:42:20 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id n59LgF0f002029; Tue, 9 Jun 2009 23:42:15 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 9 Jun 2009 23:42:15 +0200 From: Polytropon To: Martin McCormick Message-Id: <20090609234215.32201c06.freebsd@edvax.de> In-Reply-To: <200906092130.n59LUU7E000141@dc.cis.okstate.edu> References: <200906092130.n59LUU7E000141@dc.cis.okstate.edu> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Control-Z the Sleep Signal X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2009 21:42:25 -0000 On Tue, 09 Jun 2009 16:30:30 -0500, Martin McCormick wrote: > Which signal is sent to a process when one types ^z or > Control-z? It appears to be SIGSTOP and according to signal's > man page, this is one signal you can't catch. You can check the setting with this command: % stty -a cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; eol2 = ; erase = ^H; erase2 = ^H; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; ^^^^^^^^^ This entry indicates that ^Z sends the suspend signal. According to % stty -g ... status=14:stop=13:susp=1a:time=0:werase=17: ... ^^^^^^^ and % man 3 signal says that 17 SIGSTOP stop process stop (cannot be caught or ignored) And I think that 17 (decimal) is refered to as 1a (hexadecimal) in the previous stty command. > I have an application with a signal handler I wrote and > I am trying to discourage folks typing CTRL-Z if it hangs > because that does make it seem to go away but it is really still > hanging around and any lock files it created are not removed. > The effect is about as bad as if it crashed and left lock files. > Normally, CTRL-c makes it remove the locks before exiting. If I read the information above correctly, ^Z cannot be caught. (I'm always interested in statements that correct me if I'm wrong.) -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...