From owner-freebsd-hackers Tue Aug 8 7:50: 9 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from ada.eu.org (marvin.enst.fr [137.194.161.2]) by hub.freebsd.org (Postfix) with ESMTP id EC7EA37B9AA for ; Tue, 8 Aug 2000 07:50:03 -0700 (PDT) (envelope-from sam@inf.enst.fr) Received: from antinea.enst.fr (antinea.enst.fr [137.194.160.145]) by ada.eu.org (Postfix) with ESMTP id DDC9619015; Tue, 8 Aug 2000 16:49:58 +0200 (CEST) Received: by antinea.enst.fr (Postfix, from userid 1000) id CC25F2C5; Tue, 8 Aug 2000 16:49:57 +0200 (CEST) Date: Tue, 8 Aug 2000 16:49:56 +0200 To: Nicolas Leonard Cc: hackers@freebsd.org Subject: Re: How to generate a core dump explicily References: <00f101c00140$2a4b5a50$0f0210ac@masa.com> <2000-08-08-15-56-50+trackit+sam@inf.enst.fr> <011301c00146$c709f170$0f0210ac@masa.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <011301c00146$c709f170$0f0210ac@masa.com>; from nicolas.leonard@animaths.com on Tue, Aug 08, 2000 at 04:41:46PM +0200 From: Samuel Tardieu Organization: Ecole Nationale Superieure des Telecommunications Reply-To: Samuel Tardieu Content-Transfer-Encoding: 8bit X-WWW: http://www.inf.enst.fr/~tardieu/ X-Mail-Processing: Sam's procmail tools X-ICQ: 21547599 Message-Id: <2000-08-08-16-49-57+trackit+sam@inf.enst.fr> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 8/08, Nicolas Leonard wrote: | Sorry, I wasn't precise enough . | | In fact, I caught the SIGABRT signal (and the others signals which are | ending the program) | and I'm doing some ending stuff, and after that, I would like to dump a core | file. | | I could remove the handler of SIGABRT after my ending suff done, and kill | myself another | time, but I would like to know if it's possible to dump the core explicitly. | (With a dumpcore() | function or whatever ) You better remove the handler of SIGABRT then call abort(), which will not only send the SIGABRT again and dump a core but also flush all your buffers (look at /usr/src/lib/libc/stdlib/abort.c). But why don't you just use atexit(3) for registering your cleaning stuff, and let SIGABRT with its default handling? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message