The problem was that the address of the users return timespec was being saved at the wrong place. In needs to be saved in the sys call interface code rather than the do_clock_nanosleep(). My tests were a bit weak as they only did one signal rather than two or more which were required to break it. The attached patch fixes the problem and reverts the removal of the FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP code. This code meets the standard WRT signal interruption AND WRT being able to sleep for longer than MAX_LONG jiffies (something the move to HZ=1000 makes more pressing). Change log: Revert the FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP code. Fix both nanosleep() and clock_nanosleep() signal restart code. Added a few comments about how restart works. Add my name to the MAINTAINERS list. Linus Torvalds wrote: > On Sat, 8 Nov 2003, Linus Torvalds wrote: > >>That nanosleep restart seems to be broken, and quite frankly, looking at >>the mess in kernel/posix-timers.c I'm not all that surprised. The code is >>total and absolute crap. I have no idea how it's even supposed to work. > > > I'd suggest just removing the regular nanosleep() emulation from there. > The clock_nanosleep() restart is likely still broken, but at least this > way the _regular_ nanosleep() system call works correctly, and fixing > clock_nanosleep() is likely easier since the restart stuff doesn't have to > worry about _which_ system call it should restart. > -- George Anzinger george@mvista.com High-res-timers: http://sourceforge.net/projects/high-res-timers/ Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml