Re: [BUG] settimeofday(2) succeeds for microsecond value more than

george anzinger (george@mvista.com)
Sat, 12 Apr 2003 12:25:08 -0700


Aniruddha M Marathe wrote:
> |Aniruddha M Marathe wrote:
> |> Even then, I think, we can modify the settimeofday code to
> |check -1 and USEC_PER_SEC
> |> Conditions, can't we?
> |>
>
> George wrote:
>
> |Uh, sure. This is the test I prefer:
> |
> | if( (unsigned long)tv->usec > USEC_PER_SEC)
> | return EINVAL;
> |
> |
> |This change should go in do_sys_settimeofday() in kernel/time.c. It
> |will fix both settimeofday and clock_settime(CLOCK_REALTIME,... And
> |also fixes it in all archs.
> |
> |-g
>
> How about
> If( (unsigned long)tv->usec >= USEC_PER_SEC)
> return EINVAL;

Right, my mistake ;)
-g
>
> Even if tv_usec value is 10^6, it should give EINVAL.
> Man page must also be updated
> -
> 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/
>

-- 
George Anzinger   george@mvista.com
High-res-timers:  http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml

- 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/