lkml.org 
[lkml]   [2003]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: {sys_,/dev/}epoll waiting timeout
Mark Mielke wrote:
> Or, fix sys_poll(). With the +1, this means that sys_poll() would have
> a 1 in 1001 chance per second of returning one jiffie too early.

Nope. Read the expression again.

> > poll(2) takes an int, but sys_poll() takes a long.
> > I think everyone is confused :)
> > The reason I suggested "long timeout" for ep_poll is because the
> > multiply in the expression:
> > jtimeout = (unsigned long)(timeout*HZ+999)/1000;
> > can overflow if you don't. If you stick with the int, you'll need to
> > write:
> > jtimeout = (((unsigned long)timeout)*HZ+999)/1000;
>
> On a 16 bit platform, perhaps... :-)

Nope. It will overflow on a _64_ bit platform, if you give it a value
of MAXINT for example.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.050 / U:3.756 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site