From owner-freebsd-hackers Wed Jan 19 18:44:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from oracle.dsuper.net (oracle.dsuper.net [205.205.255.1]) by hub.freebsd.org (Postfix) with ESMTP id 3610B14D86 for ; Wed, 19 Jan 2000 18:44:08 -0800 (PST) (envelope-from bmilekic@dsuper.net) Received: from oracle.dsuper.net (oracle.dsuper.net [205.205.255.1]) by oracle.dsuper.net (8.9.3/8.9.3) with ESMTP id VAA07683; Wed, 19 Jan 2000 21:43:58 -0500 (EST) Date: Wed, 19 Jan 2000 21:43:58 -0500 (EST) From: Bosko Milekic To: Sabrina Minshall Cc: hackers@FreeBSD.ORG Subject: Re: PR kern/14034: gettimeofday() returns negative value? In-Reply-To: <200001200141.RAA30336@shell.accesscom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 19 Jan 2000, Sabrina Minshall wrote: >What's going one here? Successive calls to gettimeofday >yields negative elapsed time? > >Any fixes? > [ code snipped ] Well, the PR considers a different problem. What your code does is call gettimeofday() once, record the value, and then a little later, call it again while proceeding to calculate a delta between the latter and previous results. Notice the issue mentionned in the PR has been concluded to be faulty hardware. Now, I assure you, this is a problem with your code snippet. I tried this code on a DEC box running: OSF1 oracle.dsuper.net V4.0 1091 alpha And got the exact same results. The problem is the tv1 = tv2 structure equality. Since the byte order is different, you get your usec from tv1 ending up in tv2's usec field. Regards, Bosko. -- Bosko Milekic Email: bmilekic@dsuper.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message