From owner-freebsd-questions Mon Mar 22 13:29:33 1999 Delivered-To: freebsd-questions@freebsd.org Received: from kiwi.pinnacle.co.nz (pinnacle.internet.co.nz [210.48.55.133]) by hub.freebsd.org (Postfix) with ESMTP id A13F514CF1 for ; Mon, 22 Mar 1999 13:29:12 -0800 (PST) (envelope-from jonc@pinnacle.co.nz) Received: from kiwi.pinnacle.co.nz (kiwi.pinnacle.co.nz [202.37.163.2]) by kiwi.pinnacle.co.nz (8.9.3/8.9.3) with ESMTP id JAA27166; Tue, 23 Mar 1999 09:26:00 +1200 (NZST) Date: Tue, 23 Mar 1999 09:26:00 +1200 (NZST) From: Jonathan Chen To: Masahiro Ariga Cc: freebsd-questions@FreeBSD.ORG Subject: Re: how to die gracefully In-Reply-To: <000501be7472$3bbeb400$064ca8c0@gateway> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 22 Mar 1999, Masahiro Ariga wrote: > 1.How should I exit gracefully by pushing Ctl^C. I mean,what should I do to > recover normal condition in preparation for next execution ? > 2.I like to catch the signal when pushed Ctl^C,and make a handler > routine.Would you tell me what signal I can catch when enterring Ctl^C ? You need to read up on catching signals. Check out: sigemptyset sigaddset sigprocmask sigaction These can be a bit hard to read; an easier option is to get "Advanced Programming in the UNIX Environment" by Stevens. It explains all you need to know. Jonathan Chen ---------------------------------------------------------------------- When you want to test the depth of a stream, don't use both feet. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message