Re: localtime()
Jorge Almeida <[email protected]> Mon, 5 Dec 2011 08:38:19 +0000
| Newsgroups | gmane.linux.lib.dietlibc |
|---|---|
| Message-ID | <CAKpSnpJeZzpeziVpVav6ZF-AQyTMBPeR6dU1v+n=xqquKjFw-A@mail.gmail.com> |
On Mon, Dec 5, 2011 at 12:09 AM, R.L. Horn <[email protected]> wrote: > On Sun, 4 Dec 2011, Jorge Almeida wrote: > >> Subtracting 24s (each second, in a "wall-clock" program) is not ideal but >> it does the job. > > > A better interim fix is probably to link against tzlib. Fetch the sources > from: > > ftp://ftp.iana.org/tz/releases/ > > You want the most recent tzcode and tzdata tarballs (tzcode2011i.tar.gz and > tzdata2011n.tar.gz are what I used). > > Untar them into some empty directory, then compile the library with > something like: > > make cc='diet gcc' \ > TZDIR=/usr/share/zoneinfo TOPDIR=`pwd` `pwd`/lib/libtz.a > > Where TZDIR, naturally, is set to the location of your zoneinfo directory. > > You should now have a usable library in lib/libtz.a. Simply link your > programs against it. > > I tried it against test/time/tst-posixtz.c and everything passed except the > tzset() test (linking against dietlibc alone produced all FAILs). > > The only caveat is that you'll have to set a TZ environment variable, as the > tzlib functions don't respect the /etc/localtime symlink. Thanks, I'll try that. > > If this mail doesn't get rejected by Felix's servers as spam, I'll take a > look at the dietlibc code later. I only received one copy of your messages, I don't know whether your message didn't make it to the list or is just Gmail that's dropping one. I'm replying to you with copy to the list. Jorge