X-Spam-Check-By: sourceware.org Date: Sun, 11 Feb 2007 13:16:03 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: strange bug in gettimeofday function Message-ID: <20070211181603.GA4950@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <1562006224 DOT 20070211192014 AT gnu DOT org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1562006224.20070211192014@gnu.org> User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Sun, Feb 11, 2007 at 07:20:14PM +0300, Andrew Makhorin wrote: >Hi, > >I detected a strange bug in the standard function gettimeofday. >It *sometimes* reports the time which being expressed as the integer >number of milliseconds is *less* than the time obtained *earlier* with >the same function. > >The expression 1000000 * tv.tv_sec + tv.tv_usec is calculated in >64-bit arithmetic, so overflow cannot happen. The negative difference >in the time values on two successive calls is about 100 milliseconds. > >cygcheck.out is attached. In cases like this a simple test case is really required. If this is really true then calling gettimeofday in a loop should be enough to demonstrate the problem. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/