futimens/utimensat (was: Re: Change default VFS timestamp precision?)

Jilles Tjoelker jilles at stack.nl
Sat Jan 3 16:13:09 UTC 2015


On Fri, Dec 19, 2014 at 03:12:01PM -0500, Garrett Wollman wrote:
> In article <20141219194800.GA29107 at stack.nl>, jilles at 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


More information about the freebsd-arch mailing list