Why should setjmp/longjmp suck in kernel? I use it in kdb to recover
from debugging errors and to quit large amounts of output without
overloading every bit of debugging code with checks for "has the user
typed q?". It meant I had to write/modify setjmp/longjmp code to work in
the kernel for i386 and ia64, no big deal.
Given the kernel model, there are few places where setjmp/longjmp make
sense. If the code takes locks, disables interrupts etc. then forget
setjmp, cleanup after longjmp is too messy. But if you want to recover
from unexpected events in a large body of code which does not take
locks then it is a valid use for longjmp, especially if the code
requires several levels of function calls and you want to bail out from
a low level function.
-
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/