[Bug 19963] GetSystemTimeAdjustment() should return 10000000 / sysconf(_SC_CLK_TCK)

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Sep 7 08:39:39 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=19963





--- Comment #3 from red-ray <ray at pobox.co.uk>  2009-09-07 08:39:38 ---
(In reply to comment #2)
> Except you assuming that kernel by default has 10000000 ticks per second. Which
> is not true on all systems.

No, if you look at http://msdn.microsoft.com/en-us/library/ms724394(VS.85).aspx
you will see it says:

lpTimeIncrement [out] 
A pointer to a variable that the function sets to the interval between periodic
time adjustments, in 100-nanosecond units. This interval is the time period
between a system's clock interrupts.  The 10000000 is nothing to do with the
system ticks per second which is in fact returned by the sysconf(_SC_CLK_TCK)

Further Wine already uses the 10000000 constant when returning thread CPU
times.  The code is at WINE-1.1.29\dlls\ntdll\thread.c around line 1013 you
will find.

                    long clocks_per_sec = sysconf(_SC_CLK_TCK);

                    times(&time_buf);
                    kusrt.KernelTime.QuadPart = (ULONGLONG)time_buf.tms_stime *
10000000 / clocks_per_sec;
                    kusrt.UserTime.QuadPart = (ULONGLONG)time_buf.tms_utime *
10000000 / clocks_per_sec;

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list