range guarantee on gettimeofday?

range guarantee on gettimeofday?

Post by Mark A Harris » Fri, 27 Sep 1996 04:00:00



Is there any guarantee that gettimeofday will set the tv_sec
field to be 0 <= tv_sec < 1,000,000 ?

In other words, for struct timeval's returned by gettimeofday, is
it safe to assume that if a.tv_sec > b.tv_sec then a > b ?

Thanks
Mark.

--
Mark Harrison                                   http://jasper.ora.com/mh/

 
 
 

range guarantee on gettimeofday?

Post by Jeff Bonwi » Fri, 27 Sep 1996 04:00:00



Quote:>Is there any guarantee that gettimeofday will set the tv_sec
>field to be 0 <= tv_sec < 1,000,000 ?

I assume you meant tv_usec, in which case, yes -- you can assume that
the number of microseconds is in the range 0 <= usec < 1,000,000.
In general you can assume that any system service that returns a timeval
(second and microseconds) or a timestruc (seconds and nanoseconds)
will put the fractional part in the range 0 <= fraction < 1 second.

Jeff Bonwick
Solaris Performance

 
 
 

range guarantee on gettimeofday?

Post by Casper H.S. Dik - Network Security Engine » Wed, 02 Oct 1996 04:00:00



Quote:>Is there any guarantee that gettimeofday will set the tv_sec
>field to be 0 <= tv_sec < 1,000,000 ?
>In other words, for struct timeval's returned by gettimeofday, is
>it safe to assume that if a.tv_sec > b.tv_sec then a > b ?

Yes, the tv_usec value should be < 1000000; if not, it's a bug.

(Though such bugs did exist in the past)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. guaranteed read/guaranteed write routine in the kernel (no mutexes)

HP and AIX have a mechanism for doing a guaranteed read and write, without
doing any locking.  The routines fetch_and_add(), and compare_and_swap()
exist in both HP-UX and AIX, but not in SUN.  Does SUN have an equivalent?
--
Any help. like even confirming non-existence would be appreciated, thanks
- Ceri Davies

--
Anything expressed here is my best effort, not to
be taken as absolute truth and does not necessarily
express the views of my employer

2. upgrading to libc6?

3. gettimeofday(struct timeval *tp) but is in 2.4 gettimeofday(tp,tzp)

4. Newbee: Xwindows and .....

5. Monitor Sync range Versus Scan range

6. Assorted Questions

7. memory range - IO range

8. Problems unpacking XFree86 RPM

9. how to read the syntax eg gettimeofday()

10. 2.5.69-70 ide-cd to guarantee fault-free CD/DVD burning experience?

11. gettimeofday, xdrproc_t

12. Problems with Solaris gettimeofday() or localtime()

13. *100% GUARANTEED WIN BETTING* g^3>