Re: Setjmp/Longjmp in the kernel?

From: Alan Cox (
Date: Mon Feb 10 2003 - 08:00:42 EST

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
        free this
        free that

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


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:27 EST