futimens and utimensat vs birthtime

Kirk McKusick mckusick at mckusick.com
Fri Aug 14 21:22:27 UTC 2015


> From: John Baldwin <jhb at freebsd.org>
> To: freebsd-current at freebsd.org
> Subject: Re: futimens and utimensat vs birthtime
> Date: Fri, 14 Aug 2015 10:39:41 -0700
> Cc: "freebsd-fs at freebsd.org" <freebsd-fs at freebsd.org>,
>         "'Jilles Tjoelker'" <jilles at stack.nl>
> 
> 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).
> 
> -- 
> John Baldwin

I concur with John's suggestion. Add a new system call with three
argument set of times specifying birthtime as the last one. I
proposed doing this when I added birthtime, but did not as the
sentiment at the time was that it would gratuitously make FreeBSD
written applications less portable if they used this new non-standard
system call.

	Kirk McKusick


More information about the freebsd-fs mailing list