strange values with now-offsets on solaris

Started by HPW, January 05, 2004, 12:48:59 AM

Previous topic - Next topic

HPW

I just try the new 7.4.5 on solaris



My converter logs start and end-time via (now)



(2004 1 5 8 35 16 690604 5 2 387984)

(2004 1 5 8 35 19 790769 5 2 -4200384)



But I get strange values for the time-zone offsets.



On my WIN-PC I get:



(2004 1 5 8 34 59 848000 5 2 -60)

(2004 1 5 8 35 1 51000 5 2 -60)
Hans-Peter

Lutz

#1
Unfortunately compiling/linking is broken currently on Solaris at the Sourceforge compiler farm, so I don't know how to debug this. Your folks should check first the calling conventions of 'gettimeofday()' and the definition of 'struct timezone' on Solaris. The problem must be there somewhere.



The code for 'now' is in the function p_now() in nl-filesys.c





Lutz

Lutz

#2
On Solaris the members of 'struct timezone' seem to be defined as shorts, and there are also comments about 'gettimeofday()' about this topic in 'time.h' and 'tmeb.h'.



Development ersion 7.4.6 (now online) contains an attempt of a fix and also contains a fix for integer->float conversions (relevant for all platforms)



Lutz

HPW

#3
After compiling on solaris and starting the enviroment:



newLISP v7.4.6 Copyright (c) 2004 Lutz Mueller. All rights reserved.



> (now)

(2004 1 6 6 48 49 697202 6 3 1672)

> (now)

(2004 1 6 6 48 53 820801 6 3 -256)

> (now)

(2004 1 6 6 48 58 261730 6 3 -256)

> (now)

(2004 1 6 6 49 2 4484 6 3 -256)

> (now)

(2004 1 6 6 49 6 161210 6 3 -256)

> (now)

(2004 1 6 6 49 9 768666 6 3 -256)



Only the first call gives 1672 and all subsequent -256.

I am not sure if one of this number is right.



WIN:



> (date 86400)

"Fri Jan 02 01:00:00 1970"



SOLARIS



> (date 0)

"Thu Jan  1 01:00:00 1970"

> (date 86400)

"Fri Jan  2 01:00:00 1970"

> (date (apply date-value(now)))

"Tue Jan  6 08:01:45 2004"
Hans-Peter

Lutz

#4
'date' is working right and does not depend on the new value returned from 'now'.



The last value returend from 'now' is wrong, it should be normally a multiple of 60. I think it should be -60 in Germany,  if your solaris machine carries local time, sometimes unix machines run on UCT (GMT).



I will disable the last return value for 'now' on SOLARIS compiles until it can be debugged.



Lutz