From owner-cvs-src@FreeBSD.ORG Thu Oct 20 15:24:28 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E9CA16A420; Thu, 20 Oct 2005 15:24:28 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2DA543D8B; Thu, 20 Oct 2005 15:24:18 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id j9KFNLrH010481; Thu, 20 Oct 2005 09:23:21 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 20 Oct 2005 09:24:42 -0600 (MDT) Message-Id: <20051020.092442.32432175.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <25112.1129812291@critter.freebsd.dk> References: <20051020211131.A874@delplex.bde.org> <25112.1129812291@critter.freebsd.dk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Thu, 20 Oct 2005 09:23:22 -0600 (MDT) Cc: cvs-src@freebsd.org, src-committers@freebsd.org, andre@freebsd.org, cvs-all@freebsd.org, bde@zeta.org.au Subject: Re: cvs commit: src/usr.bin/vmstat vmstat.c src/usr.bin/w w.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 15:24:28 -0000 In message: <25112.1129812291@critter.freebsd.dk> "Poul-Henning Kamp" writes: : This means that there is no way to tell which side of an inserted : leapsecond a time(2) timestamp comes from: : : UTC time(2) : 23:59:57 N-3 : 23:59:58 N-2 : 23:59:59 N-1 : 23:59:60 N : 00:00:00 N : 00:00:01 N+1 Actually, time goes like the following near a leap second: 23:59:57 N-3 23:59:58 N-2 23:59:59 N-1 23:59:60 N-1 00:00:00 N 00:00:01 N+1 although mktime() will turn the above times into the sequence that you posted, mostly because POSIX didn't grok that the leap second was added to the end of the prior day, not the beginning of the next day. They mandated 'just normalize it' behavior which is sadly wrong. Ntp mandates the latter, so that's what we do over a leap second for system time. : Worst case, difftime() will be wrong by two seconds: taking the difference : from one leapsecond to another and guessing wrong in both ends. However, this nit doesn't change your main point. Warner