From owner-freebsd-current@freebsd.org Fri Aug 14 20:07:12 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91559BA69E; Fri, 14 Aug 2015 20:07:12 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (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 A87981239; Fri, 14 Aug 2015 20:07:12 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 58BD1B809B; Fri, 14 Aug 2015 22:07:09 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 413DD28494; Fri, 14 Aug 2015 22:07:09 +0200 (CEST) Date: Fri, 14 Aug 2015 22:07:09 +0200 From: Jilles Tjoelker To: John Baldwin Cc: freebsd-current@freebsd.org, Julian Elischer , "freebsd-fs@freebsd.org" Subject: Re: futimens and utimensat vs birthtime Message-ID: <20150814200709.GB88901@stack.nl> References: <55CDFF32.7050601@freebsd.org> <2405496.WdPSxGzEuT@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2405496.WdPSxGzEuT@ralph.baldwin.cx> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2015 20:07:13 -0000 On Fri, Aug 14, 2015 at 10:39:41AM -0700, John Baldwin wrote: > On Friday, August 14, 2015 10:46:10 PM Julian Elischer wrote: > > I would like to implement this call. but would like input as to it's > > nature. > > The code inside the system would already appear to support handling > > three elements, though it needs some scrutiny, > > so all that is needed is a system call with the ability to set the > > birthtime directly. > > Whether it should take the form of the existing calls but expecting > > three items is up for discussion. > > Maybe teh addition of a flags argument to specify which items are > > present and which to set. > > ideas? > I believe these should be new calls. Only utimensat() provides a flag > argument, but it is reserved for AT_* flags. I would be fine with > something like futimens3() and utimensat3() (where 3 means "three > timespecs"). Jilles implemented futimens() and utimensat(), so he > might have ideas as well. I would probably stick the birth time in > the third (final) timespec slot to make it easier to update new code > (you can use an #ifdef just around ts[2] without having to #ifdef the > entire block). Without adding new syscalls, it is possible to use the first tv_nsec to indicate that a new birth time is present. In that case, times[0].tv_nsec == UTIME_WITHBIRTHTIME would indicate that times has 4 instead of 2 elements. Whether you want to do this instead of adding two more system calls is a different question. Also note that, in some sense, the inability to set the birthtime forward is a feature. -- Jilles Tjoelker