* [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value
@ 2003-04-11 5:12 Aniruddha M Marathe
2003-04-11 6:26 ` george anzinger
0 siblings, 1 reply; 3+ messages in thread
From: Aniruddha M Marathe @ 2003-04-11 5:12 UTC (permalink / raw)
To: george; +Cc: linux-kernel, Chandrashekhar RS
Settimeofday(2) should return EINVAL in case where tv.tv_usec parameter is more than
USEC_PER_SEC (more than 10^6 ) or for negative values of tv.tv_usec.
It returns 0 (success) instead.
Clock_settimeofday(2) (kernel/posix-timers.c) also uses do_sys_settimeofday() and faces the
Same problem.
I think this is a bug. If you confirm, I will send a patch.
Regards,
Aniruddha Marathe
WIPRO Technologies, India
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value
2003-04-11 5:12 [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value Aniruddha M Marathe
@ 2003-04-11 6:26 ` george anzinger
2003-04-11 13:33 ` [BUG] settimeofday(2) succeeds for microsecond value more thanUSEC_PER_SEC " Eric Piel
0 siblings, 1 reply; 3+ messages in thread
From: george anzinger @ 2003-04-11 6:26 UTC (permalink / raw)
To: Aniruddha M Marathe; +Cc: linux-kernel, Chandrashekhar RS
Aniruddha M Marathe wrote:
> Settimeofday(2) should return EINVAL in case where tv.tv_usec parameter is more than
> USEC_PER_SEC (more than 10^6 ) or for negative values of tv.tv_usec.
> It returns 0 (success) instead.
>
> Clock_settimeofday(2) (kernel/posix-timers.c) also uses do_sys_settimeofday() and faces the
> Same problem.
>
> I think this is a bug. If you confirm, I will send a patch.
Yes, it is a known problem, turned up by some the posix timers tests.
I suppose it is too much to ask, but it would be nice if
do_sys_settimeofday() took a timespec instead of a timeval. Of course
this changes the interface for all the archs, but it would allow the
clock_settimeofday to send in the nsec value.
-g
>
> Regards,
> Aniruddha Marathe
> WIPRO Technologies, India
> -
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] settimeofday(2) succeeds for microsecond value more thanUSEC_PER_SEC and for negative value
2003-04-11 6:26 ` george anzinger
@ 2003-04-11 13:33 ` Eric Piel
0 siblings, 0 replies; 3+ messages in thread
From: Eric Piel @ 2003-04-11 13:33 UTC (permalink / raw)
To: george anzinger; +Cc: Aniruddha M Marathe, linux-kernel, Chandrashekhar RS
george anzinger wrote:
>
> I suppose it is too much to ask, but it would be nice if
> do_sys_settimeofday() took a timespec instead of a timeval. Of course
> this changes the interface for all the archs, but it would allow the
> clock_settimeofday to send in the nsec value.
IMHO on IA64 it would not be a bad idea since internally everything is
computed on nsec. Currently there is conversion from usec to nsec at the
beginning of do_sys_settimeofday() :-)
I could support you on IA64 to do the change if this is needed.
Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-04-11 13:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-11 5:12 [BUG] settimeofday(2) succeeds for microsecond value more than USEC_PER_SEC and for negative value Aniruddha M Marathe
2003-04-11 6:26 ` george anzinger
2003-04-11 13:33 ` [BUG] settimeofday(2) succeeds for microsecond value more thanUSEC_PER_SEC " Eric Piel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox