From owner-freebsd-arch@FreeBSD.ORG Sat Jan 3 16:13:09 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFC6B7EE; Sat, 3 Jan 2015 16:13:09 +0000 (UTC) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B383F4F; Sat, 3 Jan 2015 16:13:09 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A8E73359306; Sat, 3 Jan 2015 17:13:06 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 8E32128494; Sat, 3 Jan 2015 17:13:06 +0100 (CET) Date: Sat, 3 Jan 2015 17:13:06 +0100 From: Jilles Tjoelker To: Garrett Wollman Subject: futimens/utimensat (was: Re: Change default VFS timestamp precision?) Message-ID: <20150103161306.GB46373@stack.nl> References: <201412161348.41219.jhb@freebsd.org> <77322.1418933100@critter.freebsd.dk> <77371.1418933642@critter.freebsd.dk> <7567696.mqJ3jgzJgL@ralph.baldwin.cx> <82135.1419010861@critter.freebsd.dk> <20141219194800.GA29107@stack.nl> <201412192012.sBJKC1rW086109@hergotha.csail.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412192012.sBJKC1rW086109@hergotha.csail.mit.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: portmgr@FreeBSD.org, pluknet@FreeBSD.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 16:13:09 -0000 On Fri, Dec 19, 2014 at 03:12:01PM -0500, Garrett Wollman wrote: > In article <20141219194800.GA29107@stack.nl>, jilles@stack.nl writes: > >Because there is no API to set timestamps with nanosecond resolution, > >and therefore a cp -p copy of a file will appear older than the original > >with 99.9% probability. I think that is undesirable. > But that's something we can easily fix -- and should have done, years > ago. Why don't we just *do* that? > Of course, in the case of NFS clients, where this issue is most > severe, the RPCs are already defined. The underlying VOP_SETATTR has > no trouble with nanoseconds, either. It's just a matter of providing > a standard library interface (and associated system call(s)) to do it, > and since Linux has already implemented this, we can just implement > that interface and applications will get it "for free". OK, I dusted off the old patch from pluknet@ and added many necessary things. Please review at https://reviews.freebsd.org/D1426 I added a compatibility wrapper, mainly to save portmgr some work. Of course, this does not add to the old kernel a version of lutimes() that works relative to a file descriptor. I also have changes for cp, mv and more utilities, but that's a different patch. There is also contrib code that either only supports old calls or is explicitly configured to use only old calls. -- Jilles Tjoelker