Re: [RFC][PATCH] new timeofday-based soft-timer subsystem

From: Nish Aravamudan
Date: Tue May 03 2005 - 13:13:26 EST


On 5/3/05, Chris Friesen <cfriesen@xxxxxxxxxx> wrote:
> Nishanth Aravamudan wrote:
>
> > but then there is another issue: the restart_block used by
> > sys_nanosleep() only allows for 4 unsigned long arguments, when, in
> > fact, nanoseconds are a 64-bit quantity in the kernel. As long as the
> > nanosleep() request is no more than around 4 seconds, we should be ok
> > using unsigned longs.
>
> My man page for nanosleep specifies that the "nanoseconds" portion of
> the timespec must be under 1 billion and is of type "long". Is that no
> longer valid?

Certainly would be, but the problem is if you pass in a timespec ts, where

ts.tv_sec = 10;
ts.tv_nsec = 99999;

This will overflow a 32-bit nanosecond representation internally
(10000099999 > 4294967296). Sorry for the confusion, the unsigned long
I was referring to was the internal representation of the nanoseconds
converted from the timespec parameter.

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