bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Re: [PATCH] fdutimensat: add an atflag parameter


From: Eric Blake
Subject: [Bug-tar] Re: [PATCH] fdutimensat: add an atflag parameter
Date: Fri, 17 Sep 2010 14:28:40 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3

On 09/17/2010 02:17 PM, Paul Eggert wrote:
On 09/17/2010 01:40 PM, Eric Blake wrote:

not to mention inconsistent with all the other *at functions

On the contrary, the current gnulib name "fdutimens" is inconsistent
with the usual POSIX naming conventions.  In POSIX, functions like
"fdopen" put the fd first.  "fdutimens" (and "fdutimensat") are the
only gnulib functions that violate the POSIX naming conventions in
that way, and this is what I'd like to fix.

So your argument is that the prefix of fd trumps the suffix of at on which argument to put first. OK, I guess I can buy that.

Yes.  fdutimens has the same problem as fdutimensat, and if one is
changed the other should be too.  That's OK, since fdutimens is merely
a gnulib function.

And since we've already made one API change this week (for fdutimensat), making another two (changing fdutimens to have the signature that gl_futimens currently has, and deleting gl_futimens) could be okay.

That sounds like more work than it's worth.  Let's just pick one set
of names and go with them.  Nobody else is using these names, so we
can choose the names we like.  I prefer the names without the "gl_"
prefixes but could be talked into the "gl_", I suppose.  The more
important thing from my point of view is to put the fd first.

I guess you're starting to convince me: the _only_ interface pattern we need is:

fdutimens (fd, name, time)
fdutimensat (fd, dir, name, time, flag)
fdchmod (fd, name, mode)
fdchmodat (fd, dir, name, mode, flag)

because they are fd* wrappers around these function pairs:

futimens (fd, time) and utimens (name, time)
futimens (fd, time) and utimensat (dir, name, time, flag)
fchmod (fd, mode) and chmod (name, mode)
fchmod (fd, mode) and fchmodat (dir, name, mode, flag)

In other words, creation of an fd* wrapper entails combining the fd from the fd-variant first, and all other arguments from the name-based variant second.

So, would you like me to start making the changes?

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]