samba 2.2.8/time.c Question on VMS specific modification.

COLLOT Jean-Yves jean-yves.collot at cofiroute.fr
Mon Oct 11 14:50:54 GMT 2004


> Can you set your mailer to not put a space the "RE" tag before the ":"?
> It should be the vendor's default setting.

I understand the problem, but I really don't know how to do that. My mailer
is Outlook 2002 SP2, and I wandered through most of the menus without
finding where I can change it.
If anyone knows, please tell me.
In the meantime, I'll remove manually the blank between "RE" and ":". Please
don't be too angry if I forget sometimes.

> Now I need to find out if this is a VMS C RTL bug or a SAMBA bug, as
> there should not be a difference.

It's definitely a SAMBA bug. The idea is quite simple: the first time you
call the "optimized" localtime(), it construct a table of the different
offsets, in seconds, between the localtime and the gmttime for now and some
time in the future. It does that by calling the standard C library
localtime(), by the way.
So, for subsequent calls, it checks the table, gets the current offset, then
calls gmtime() after having added that offset to the gmt time. Of course,
with gmtime(), the  tm_isdst and the tm_gmtoff members of the tm struct are
always null. 
Setting the correct tm_gmtoff is easy: it's the offset from the table.
Setting correctly the tm_isdst is probably more difficult. But is this
member used anywhere in Samba?

Actually, I had a second reason not to use that "optimized" thing. In the
original code, it is implemented by "Localtime" replacing "localtime". With
the VMS C compiler, you can deal with such things (using /NAME=AS_IS), but
in my opinion, it is a real pain, and you may easily introduce a number of
fine bugs by using such a feature in VMS in such a complicated software,
especially when you use that with a standard C RTL name.
So, I had a choice : make 2 or 3 specific VMS changes in order to replace
"Localtime" by something like "samba_localtime", or only one to completely
disable that "optimized" feature, that is a little buggy anyway, and does
not actually optimize anything in VMS (I experienced that 50000 calls to
standard localtime() take 0.50 sec CPU).
 
You know what my choice was.

JY



More information about the samba-vms mailing list