Are ctime/localtime busted?

Paul De Bra debra at alice.UUCP
Sun Feb 5 09:56:43 AEST 1989


In article <1135 at ssbn.WLK.COM> bill at 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 at research.att.com   | uunet!research!debra     |
------------------------------------------------------



More information about the Comp.unix.microport mailing list