If you thought setjmp() and longjmp() were evil, check out getcontext(), makecontext(), setcontext() and swapcontext().
(SysV-ish systems only, which includes Linux)
I remember stumbling across those once upon a time and thinking they were the sort of thing a mad scientist would make … or maybe just a Scottish programmer.
This is based on the idea that most things famously Scottish could easily be the result of a dare: golf, haggis, caber tossing, kilts, deep-fried Snickers bars, bagpipes…
You must be logged in to post a comment.