From owner-freebsd-hackers Thu Jan 9 10:16:44 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B61637B401 for ; Thu, 9 Jan 2003 10:16:43 -0800 (PST) Received: from falcon.midgard.homeip.net (h76n3fls20o913.telia.com [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id DCDC343E4A for ; Thu, 9 Jan 2003 10:16:41 -0800 (PST) (envelope-from erikt@falcon.midgard.homeip.net) Received: (qmail 66299 invoked by uid 1001); 9 Jan 2003 18:16:40 -0000 Date: Thu, 9 Jan 2003 19:16:40 +0100 From: Erik Trulsson To: Pawel Jakub Dawidek Cc: Jake Burkholder , freebsd-hackers@freebsd.org Subject: Re: Exceptions via setjmp/longjmp in kernel. Message-ID: <20030109181640.GA66243@falcon.midgard.homeip.net> Mail-Followup-To: Pawel Jakub Dawidek , Jake Burkholder , freebsd-hackers@freebsd.org References: <20030109143059.GC47263@prioris.mini.pw.edu.pl> <20030109110355.C4032@locore.ca> <20030109162520.GB51455@prioris.mini.pw.edu.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030109162520.GB51455@prioris.mini.pw.edu.pl> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Jan 09, 2003 at 05:25:20PM +0100, Pawel Jakub Dawidek wrote: > On Thu, Jan 09, 2003 at 11:03:55AM -0500, Jake Burkholder wrote: > +> The kernel longjmp only ever seems to return 1. See i386/i386/support.s. > > That's right, thanks! > > But this is strange, setjmp/longjmp are defined in C99 and there > setjmp() returns value from longjmp(). setjmp/longjmp are defined in C99 for *hosted* C implementations. When compiling a kernel one is almost certainly using a freestanding C implementatio, which basically means that there are only a few library facilities that need be present. Setjmp/longjmp is not among them. This means that for the kernel setjmp/longjmp the C standard has nothing to say about their behaviour. It might of course be desirable to make them work the same as the standard facilities as far as it is practical, but it is not always practical. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message