Patch frmo mainstream, merged by Pavel (xemul@): Add msleep_interruptible() function to kernel/timer.c This is a merge of three patches from janitor@ and Co: http://linux.bkbits.net:8080/linux-2.6/gnupatch@4138ab70Qo9q3NhN2oCmPsvbtAlsUw http://linux.bkbits.net:8080/linux-2.6/gnupatch@417c4a7cbEj-tPVGsHVgooPY1Bm0_g http://linux.bkbits.net:8080/linux-2.6/gnupatch@41602673Fsjah1EZ1fphOKm3s59YCA --- ./kernel/timer.c.msi 2005-10-20 13:33:52.000000000 +0400 +++ ./kernel/timer.c 2005-10-20 17:15:42.775194800 +0400 @@ -1526,3 +1526,19 @@ void msleep(unsigned int msecs) EXPORT_SYMBOL(msleep); +/** + * msleep_interruptible - sleep waiting for signals + * @msecs: Time in milliseconds to sleep for + */ +unsigned long msleep_interruptible(unsigned int msecs) +{ + unsigned long timeout = msecs_to_jiffies(msecs) + 1; + + while (timeout && !signal_pending(current)) { + __set_current_state(TASK_INTERRUPTIBLE); + timeout = schedule_timeout(timeout); + } + return jiffies_to_msecs(timeout); +} + +EXPORT_SYMBOL(msleep_interruptible); --- ./include/linux/delay.h.msi 2005-09-26 13:31:46.000000000 +0400 +++ ./include/linux/delay.h 2005-10-20 17:11:37.132538160 +0400 @@ -39,5 +39,6 @@ extern unsigned long loops_per_jiffy; #endif void msleep(unsigned int msecs); +unsigned long msleep_interruptible(unsigned int msecs); #endif /* defined(_LINUX_DELAY_H) */