Re: Setjmp/Longjmp in the kernel?

Alan Cox (alan@lxorguk.ukuu.org.uk)
10 Feb 2003 13:00:42 +0000


On Sun, 2003-02-09 at 22:10, John W. M. Stevens wrote:
> Among these is a simple exception support system. The core
> of this system is based on the existence of a setjmp/longjmp
> facility. In digging through the source code, I've found a
> few, architechturally specific implementations of such a
> facility, but no generalized, multi-platform support.

setjmp/longjmp are normally very hard to follow and maintain,
especially when the kernel has locks, sleeping rules and
multiple threads flying around.

You will see lots of code which does either

int foo_func()
{
alloc this
alloc that
_foo_func()
free this
free that
}

or has a single exit path and uses goto out type constructs

instead

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/