On 05/26/2013 03:08:17 AM, richard -rw- weinberger wrote: > On Sun, May 26, 2013 at 1:01 AM, Hopsing K <hopsi...@gmail.com> wrote: > > Some question at the side: can you call longjmp from within a signal > > handler? My first assumption was that UML uses longjmp from within > > the SIGALRM handler to implement preemption, butseems not to .
Yes, "man longjmp" shows you sigsetjmp() and siglongjmp(), which save and restore the signal mask. This is an important detail because the signal you're handling is disabled in the signal handler (to avoid an infinite loop). You can just setjmp() and longjmp() and fiddle with the signal mask yourself, but signals can nest (a different signal can interrupt a signal handler) so re-enabling just one may not be enough. On return, the kernel re-enables the signal you were handling, even from nested signal handlers. But if you longjmp() you don't call the kernel return code... Rob ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel