Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!mit-eddie!rutgers!att!ulysses!andante!alice!debra From: debra@alice.UUCP (Paul De Bra) Newsgroups: comp.unix.microport Subject: Re: Are ctime/localtime busted? Keywords: V/AT 2.4 Message-ID: <8867@alice.UUCP> Date: 4 Feb 89 23:56:43 GMT References: <1135@ssbn.WLK.COM> Reply-To: debra@alice.UUCP () Distribution: na Organization: AT&T, Bell Labs Lines: 25 In article <1135@ssbn.WLK.COM> bill@ssbn.WLK.COM (Bill Kennedy) writes: }This one is a puzzle and I suspect that it is something peculiar }in my system. It's V/AT 2.4, 4Mb RAM, 12MHz, plenty of disk space. }If I run the example code below with the V/AT system I get a date }and time that wander all over the place. If I run it on ssbn }(AT&T 386 UNIX Vr3.1) it works correctly every time. I should add }that the V/AT date(1) works OK and setup shows that the cmos time }is correct too. Here's the sample and the answers I got: }... } long systime, time(); }... } systime = time( (long *) 0 ); }... I've seen this bug in several versions of Unix. On some systems time(0L) doesn't work. time(tloc) where tloc is a (properly initialized) pointer to a long should work. Paul. -- ------------------------------------------------------ |debra@research.att.com | uunet!research!debra | ------------------------------------------------------