From owner-cvs-all@FreeBSD.ORG Tue Apr 10 13:28:12 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5203816A402; Tue, 10 Apr 2007 13:28:12 +0000 (UTC) (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 E3B3613C44B; Tue, 10 Apr 2007 13:28:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.8/8.13.4) with ESMTP id l3ADQxSe076364; Tue, 10 Apr 2007 07:26:59 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 10 Apr 2007 07:27:10 -0600 (MDT) Message-Id: <20070410.072710.1678773672.imp@bsdimp.com> To: grog@freebsd.org From: "M. Warner Losh" In-Reply-To: <20070410050011.GH91694@wantadilla.lemis.com> References: <20070410010510.GB61460@wantadilla.lemis.com> <20070409.222011.1689682576.imp@bsdimp.com> <20070410050011.GH91694@wantadilla.lemis.com> X-Mailer: Mew version 4.2 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]); Tue, 10 Apr 2007 07:26:59 -0600 (MDT) Cc: cvs-src@freebsd.org, src-committers@freebsd.org, brian@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.bin/touch touch.1 touch.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 13:28:12 -0000 In message: <20070410050011.GH91694@wantadilla.lemis.com> "Greg 'groggy' Lehey" writes: : On Monday, 9 April 2007 at 22:20:11 -0600, M. Warner Losh wrote: : > In message: <20070410010510.GB61460@wantadilla.lemis.com> : > "Greg 'groggy' Lehey" writes: : >> On Monday, 9 April 2007 at 2:48:26 -0700, Brian Somers wrote: : >>> I don't understand what this means. File times are in UTC aren't : >>> they? : >> : >> No, they're in time_t. But if you import files from other systems, : >> you frequently get times which are off by some time zone offset. : > : > time_t is UTC, by definition (sadly, POSIX has enshrined a broken : > definition of UTC as the time_t definition, but that's not important : > right now). : : The definition of time_t is simply a number of seconds since a : specified event. It's true that this event was the turn of the : year/decade in UTC, but that doesn't make it UTC. Currently my time_t : is 1176181168; that's not directly recognizable as any time zone. You are incorrect. POSIX defines time_t as UTC. Full stop. It is the definition of time_t. It defines it in a way that's broken for leap seconds, so it isn't just an interval of seconds since some arbitrary epoch. time_t is also, confusingly, used in some places to specify a interval in things like select. However, this is an abuse of a convenient type. : > It cannot be a localtime. Localtime conversion of time_t is done by : > libc to print the local time. : : But libc also needs to convert time_t to UTC. No. Libc assumes time_t is UTC. See for example gmtime and localtime. These take the same argument, but one returns the UTC time (eg, the argument unbiased by localtime broken down into year, hour, month, etc), while the other one returns the localtime (the argument, biased by localtime and then broken down). Even when one sets one CMOS clock to localtime, and maintains it by adjkerntz and friends, the system clock is still in UTC. Warner