Hm, the old AOLserver 4.0.7 version of Ns_GetTime() had a Windows
ifdef which is entirely missing from Naviserver! (See below.)
I found two relevant commits in Mercurial, from 2009 and 2012, below.
>From those logs, it looks like what happened is that in 2009, Zoran
removed the platform specific C code and instead made Naviserver call
Tcl_GetTime (somehow). Then in 2012, Gustaf added back the old
Unix-specific gettimeofday() implementation for performance reasons.
So should we just add back the old Windows-specific C implementation
too? Or is it better to use Zoran's way of invoking Tcl_GetTime? Do
we even know for sure if that method really is "platform-independent"
as Zoran thought it was? E.g., did Zoran or someone else at Archiware
test it on Windows?
Part of Ns_GetTime() from ancient AOLserver 4.0.7 sources:
------------------------------------------------------------
#ifdef _WIN32
/*
* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970
*/
#define EPOCH_BIAS 116444736000000000i64
union {
unsigned __int64 i;
FILETIME s;
} ft;
GetSystemTimeAsFileTime(&ft.s);
timePtr->sec = (time_t)((ft.i - EPOCH_BIAS) / 10000000i64);
timePtr->usec =(long)((ft.i / 10i64) % 1000000i64);
#else
#endif
changeset: 2435:16508ab4b3de
user: Gustaf Neumann <[email protected]>
date: Fri Nov 02 01:54:38 2012 +0100
files: configure.in include/nsconfig.h.in nsthread/time.c
description:
use gettimeofday() if available instead of the rount trip to tcl
changeset: 2009:4bf1ee6ebf84
user: Zoran Vasiljevic <[email protected]>
date: Sat Sep 29 14:14:03 2007 +0100
files: ChangeLog nsproxy/nsproxylib.c nsthread/time.c
description:
Ns_GetTime now relies on Tcl_GetTime to be platform-independent
--
Andrew Piskorski <[email protected]>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel