Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/compat/linux/common



Emmanuel Dreyfus wrote:

> Module Name:  src
> Committed By: manu
> Date:         Tue Nov  8 21:28:49 UTC 2005
> 
> Modified Files:
> 
>       src/sys/compat/linux/common: linux_futex.c
> 
> Log Message:
> 
> Correctly computes futex timeout.

+               timeout_hz = (timeout.tv_sec * hz)
+                          + ((timeout.tv_nsec * hz) / 1000000000);

It looks like we might have the chance of an overflow here.
hz * 999,999,999 will be > 32bits for pretty much any value of hz.
Maybe look at hzto() in kern_clock.c to see how it avoids
overflow?

Simon.
--
Simon Burge                            <simonb%wasabisystems.com@localhost>
NetBSD Support and Service:         http://www.wasabisystems.com/



Home | Main Index | Thread Index | Old Index