Subject: gettimeofday()
To: NetBSD Mailing List <port-mac68k@NetBSD.ORG>
From: David A. Gatwood <marsmail@globegate.utm.edu>
List: port-mac68k
Date: 12/16/1997 15:03:17
I sent this to a MkLinux list, but there's been really little traffic
since they switched mail servers and so I figured I'd ask this here, since
this list seems about a thousand times more active right now. ;-) It's
also just as appropriate/inappropriate, since I tried it on puma with the
same result. ;-)
I'm having some trouble with gettimeofday(), specifically the
timezones....
struct timezone tz;
.
.
.
if (!gettimeofday(NULL, &tz)) {
tmhour=tmhour+(ustr[user].gmtbias+((tz.tz_minuteswest)/60));
write_user(user,mess);
}
else {
write_user(user,"gettimeofday() failed in tz_set\n\r");
tmhour=tmhour+(ustr[user].gmtbias-GLOBAL_BIAS);
}
gettimeofday always returns 0 (success), but the minuteswest is also
always zero. Not having any experience with this call, I've turned
HAS_GETTIMEOFDAY off in my code (always have a backup plan)... but I'd
really like to fix the problem rather than just patch around it....
Ideas?
David
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/CC/FA/H/L/MC/M/MU/PA/TW d-@ s:>- a-- C++++>$ UBLAS*++++>$
P+?>$ L+++>$ !E--- W+++>$ N++(+++)>+++$ !o? K-? !w--- !O
M++>$ !V-- PS+>$ !PE- Y+>$ PGP+>$ t+++>$ 5+>++++$ !X- !R tv+>$
b++>$ !DI !D- G++(+++)>$ e>++++ h--! r--- !y-
------END GEEK CODE BLOCK------
=========================================================================
Unsubscribe:
<mailto:mklinux-development-system-unsubscribe@public.lists.apple.com>
Help: <http://www.lists.apple.com/mklinux.html>
or <mailto:mklinux-info@public.lists.apple.com>