🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3793

Re: timezone macro for autoconf?

#3793
From: Paul Eggert
Date: Wed, 26 Apr 2000 00:00
25 lines
2188 bytes
Russ Allbery <rra@stanford.edu> writes:

>I'd really like to isolate the time zone
>handling in INN to as few places as possible and just use UTC everywhere
>else; I think it makes the code a lot easier to follow.

Sounds good to me.

>Right now, struct timeval looks like the de facto
>standard regardless of what the de jure standard says.

I disagree, because gettimeofday is a porting hassle in practice.
On some hosts, you must pass a second argument to gettimeofday,
which is either ignored or not (depending on the host).
On other hosts, you must pass only one argument to gettimeofday.
And some hosts don't have gettimeofday, or put it in some nonstandard place.
In Solaris, there are two versions of gettimeofday, one in libucb
and the other in libc, which can lead to linking hassles for those poor
misguided souls who still want to use libucb.

I don't bother with gettimeofday porting hassles any more.  If a host
has clock_gettime and if it succeeds then I use it; on older hosts I
fall back on 'time'.  This is easier to maintain, and yields more
precise results on modern hosts than gettimeofday would.  See the
source code to GNU make for an example of this approach.
Technical Details
Message-ID: <8e77kv$hgk$1@ruby.twinsun.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <38FBB4DB.DE12E1C4@alumni.caltech.edu> <ylitx8qbiy.fsf@windlord.stanford.edu> <8e2dtj$ff6$1@ruby.twinsun.com> <ylsnwbj6jb.fsf@windlord.stanford.edu> <8e4lu9$fvu$1@ruby.twinsun.com> <yl66t569md.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c696,8ce1c34c9f5a1eaa
X-Google-Attributes: gid10c696,public
X-Google-Thread: 109f73,8ce1c34c9f5a1eaa
X-Google-Attributes: gid109f73,public
X-Google-Thread: fc89c,8ce1c34c9f5a1eaa
X-Google-Attributes: gidfc89c,public
From: eggert@twinsun.com (Paul Eggert)
Subject: Re: timezone macro for autoconf?
Date: 2000/04/26
Message-ID: <8e77kv$hgk$1@ruby.twinsun.com>
X-Deja-AN: 615981407
References: <38FBB4DB.DE12E1C4@alumni.caltech.edu> <ylitx8qbiy.fsf@windlord.stanford.edu> <8e2dtj$ff6$1@ruby.twinsun.com> <ylsnwbj6jb.fsf@windlord.stanford.edu> <8e4lu9$fvu$1@ruby.twinsun.com> <yl66t569md.fsf@windlord.stanford.edu>
X-Complaints-To: news@twinsun.com
X-Trace: tattoo.twinsun.com 956768733 11665 192.54.239.31 (26 Apr 2000 17:05:33 GMT)
Organization: Twin Sun Inc, El Segundo, CA, USA
NNTP-Posting-Date: 26 Apr 2000 17:05:33 GMT
Newsgroups: comp.unix.programmer,comp.os.linux.development.apps,gnu.utils.help