Date: Thu, 9 Jan 2003 11:03:55 -0500 From: Jake Burkholder <jake@locore.ca> To: Pawel Jakub Dawidek <P.Dawidek@prioris.mini.pw.edu.pl> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Exceptions via setjmp/longjmp in kernel. Message-ID: <20030109110355.C4032@locore.ca> In-Reply-To: <20030109143059.GC47263@prioris.mini.pw.edu.pl>; from P.Dawidek@prioris.mini.pw.edu.pl on Thu, Jan 09, 2003 at 03:30:59PM %2B0100 References: <20030109143059.GC47263@prioris.mini.pw.edu.pl>
index | next in thread | previous in thread | raw e-mail
Apparently, On Thu, Jan 09, 2003 at 03:30:59PM +0100,
Pawel Jakub Dawidek said words to the effect of;
> Hello hackers...
>
> I got strange problem when trying to implement something like exceptions
> with setjmp()/longjmp() functions.
>
> [...]
> int ret;
> jmpbuf buf;
> [...]
> ret = setjmp(buf);
> KASSERT(ret != 1, ("I never return 1 with longjmp()."));
> [...]
> longjmp(buf, value_diffrent_than_1);
> [...]
>
> And setjmp() returns only 0 or 1 (when longjmp() is called), but never
> returns value that I've put in longjmp() call.
>
> There could be some other problems in using setjmp()/longjmp()
> in kernel? I'm paying attention on memory leaks and locks that are
> done before longjmp().
The kernel longjmp only ever seems to return 1. See i386/i386/support.s.
Jake
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030109110355.C4032>
