This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_ticks_to_timespec()
- To: Nielsen Linus <Linus dot Nielsen at elema dot siemens dot se>
- Subject: Re: [ECOS] cyg_ticks_to_timespec()
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 19 Apr 2001 22:55:48 +0100
- Cc: ecos-discuss at sourceware dot cygnus dot com
- Organization: Red Hat UK Ltd.
- References: <63E7EC6F3685D311B640080006279198066A0527@visbur.siemens.se>
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