This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cyg_ticks_to_timespec()


Nielsen Linus wrote:
> 
> > So it seems that rounding off is intentional. In which case I
> > should just
> > tweak cyg_ticks_to_timespec to fix up the value if tv_nsec is
> > negative.
> > Before I do it, I just want to check my understanding that
> > the convertors
> > are doing the right thing by rounding not truncating.
> >
> > Jifl
> 
> I can't think of a reason to round off. Can anyone else?

After some discussion IRL this is intentional because if you are e.g.
converting 4999999999ns to seconds, this should come out as 5 seconds, not
4. But this fact wasn't accounted for in cyg_ticks_to_timespec.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]