⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 150

📁 Unix/Linux 网络时间协议版本3 Network Time Protocol Version 3 (NTP) distribution for Unix systems
💻
字号:
Received: from copland.udel.edu by huey.udel.edu id aa02555; 9 Jun 97 4:05 EDTReceived: from calliope1.fm.intel.com ([132.233.247.10]) by copland.udel.edu (8.8.5/8.7.3) with ESMTP id EAA03658 for <mills@udel.edu>; Mon, 9 Jun 1997 04:04:56 -0400 (EDT)Received: from fmmail.fm.intel.com by calliope1.fm.intel.com (8.8.4/10.0i); Mon, 9 Jun 1997 08:04:55 GMTReceived: (from ccmgate@localhost) by fmmail.fm.intel.com (8.8.5/8.7.3) id BAA00154 for mills@udel.edu; Mon, 9 Jun 1997 01:04:56 -0700 (PDT)Received: by ccm.fm.intel.com (ccmgate 3.2 #2) Mon, 09 Jun 97 01:04:56 PDTDate: Mon, 09 Jun 97 00:57:00 PDTFrom: Viraj Bais <Viraj_Bais@ccm.fm.intel.com>Message-ID: <Mon, 09 Jun 97 01:04:22 PDT_10@ccm.fm.intel.com>To: mills@udel.eduSubject: Re: Daylight Savings bug in 3-5.90 on NTDave,FYI, the NT port of xntp requires a bug fix. Following is my post in thenewsgroup explaining the problem.Regards,Viraj Bais<viraj_bais@ccm.fm.intel.com>_______________________________________________________________________________Greg Schueman wrote:> > I have heard several reports of this problem.  I have not yet found the> solution in the code base.  I'm not sure where in NTP the problem is being> introduced. I am actively looking into it, but it might be a month as I only > have snippets of time available.>> -GregThere is a bug in the NT _ftime() system call (actually in one of theWin32 API's that the _ftime() calls, I forget which one but one canfind out by stepping the code through the debugger) that returnsincorrect values if your timezone is one that does not adjust fordaylight's savings. In the xntp3.5f version, we have made somechanges to the winnt_gettimeofday() routine in lib/machines.cfile to fix this bug. I have not looked at 3.5-90, it would needsomething similar.OLD CODE:intwinnt_gettimeofday(tv)        struct timeval *tv;{        struct _timeb timebuffer;        _ftime(timebuffer);        tv->tv_sec = (long)timebuffer.time;        tv->tv_usec = (long) (1000 * timebuffer.millitm));        return 0;}CORRECTED CODE:// 100ns intervals between 1/1/1601 and 1/1/1970 as reported by// SystemTimeToFileTime()#define FILETIME_1970 0x019db1ded53e8000const BYTE DWLEN = sizeof(DWORD) * 8; //number of bits in DWORDintwinnt_gettimeofday(tv)        struct timeval *tv;{        FILETIME ft;        __int64 msec;        GetSystemTimeAsFileTime(&ft); // 100ns intervals since 1/1/1601        msec = (__int64)ft.dwHighDateTime << DWLEN | ft.dwLowDateTime;        msec = (msec - FILETIME_1970) / 10;        tv->tv_sec = (long) (msec / 1000000);        tv->tv_usec = (long) (msec % 1000000);        return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -