Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Greg Lindahl <lindahl@cs.virginia.edu>
To: axp-list@redhat.com
Subject: Re: struct timeval problem
Date: Fri, 15 Jan 1999 16:13:34 -0500 (EST)	[thread overview]
Message-ID: <199901152113.QAA24246@adder.cs.Virginia.EDU> (raw)
In-Reply-To: <199901152100.NAA21342@netcom11.netcom.com> from "Munagala V. S. Ramanath" at Jan 15, 99 01:00:20 pm

> Just noticed a discrepancy in RH 5.2 in the way 'struct timeval' is
> defined in /usr/include/timebits.H:

All non-Linux OSes seem to have a long for those fields. Linux has
been confused about it for a while, and I am unhappy to see that the
confusion is continuing. Doesn't anybody own a copy of the standard?

> This means that code that previously did this:
>     gettimeofday( &p, &q ) ;
>     s = ctime( &p.tv_sec ) ;
> 
> now needs to do this:
> 
>     time_t tmp ;
>     gettimeofday( &p, &q ) ;
>     tmp = p.tv_sec ;
>     s = ctime( &tmp ) ;

That is already required since I don't think that tv_sec is supposed
to be a time_t... a bug in the standard. But we have to follow the
bugs, too.

-- greg


  reply	other threads:[~1999-01-15 21:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-15 21:00 struct timeval problem Munagala V. S. Ramanath
1999-01-15 21:13 ` Greg Lindahl [this message]
1999-01-16  3:43   ` Richard Henderson
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox