lkml.org 
[lkml]   [1999]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPatches to make select, poll and nanosleep calculate timeout in the same way.
Hi Linus,

Here are two small patches (against 2.2.10) to make
select, poll and nanosleep calculate timeout jiffies
in the same way.

Dong--- linux/fs/select.c.save Tue Jul 6 16:45:28 1999
+++ linux/fs/select.c Tue Jul 6 16:51:43 1999
@@ -389,7 +389,7 @@
if (timeout) {
/* Carefula about overflow in the intermediate values */
if ((unsigned long) timeout < MAX_SCHEDULE_TIMEOUT / HZ)
- timeout = (unsigned long)(timeout*HZ+999)/1000+1;
+ timeout = (unsigned long)(timeout*HZ+999)/1000;
else /* Negative or overflow */
timeout = MAX_SCHEDULE_TIMEOUT;
}
--- linux/kernel/sched.c.save Fri Jul 2 13:40:29 1999
+++ linux/kernel/sched.c Tue Jul 6 16:51:54 1999
@@ -1921,7 +1921,7 @@
return 0;
}

- expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
+ expire = timespec_to_jiffies(&t);

current->state = TASK_INTERRUPTIBLE;
expire = schedule_timeout(expire);
\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.019 / U:2.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site