On 09/17/2010 12:14 PM, Paul Eggert wrote:
Thanks for adding that functionality to gnulib. I prepared a patch
to have GNU tar use it, but found one more problem. fdutimensat
uses this signature:
fdutimensat (int dir, char const *file, int fd, [ other args ] )
whereas the similar function in GNU tar uses the following
order instead.
fdutimensat (int fd, int dir, char const *file, [ other args ] )
The GNU tar convention is clearer, since it reflects the
semantics better: try FD first, and use that if it works;
otherwise fall back on DIR+FILE. Could we please switch to
this order, while we're changing the API anyway?
Hmm; I'm reluctant to make the change. Look at the history of
utimensat.h: originally, we declared futimens (fd, name, times), but
that conflicted with the POSIX naming, so it was renamed gl_futimens
(fd, name, times). But when it came time to extend it to the *at
calling conventions, all of our macros for quickly implementing openat
on top of open, mkdirat on top of mkdir, and so forth, all expected that
the wrapped function have name be first. So I added fdutimens (name,
fd, times), at which point I rewrote gl_futimens to be a thin wrapper
around fdutimens that swapped arguments, and added utimensat using the
*at implementation that had fdutimens with name first.
Now you're proposing making fdutimensat have the opposite signature from
fdutimens (fd before name, instead of after), not to mention
inconsistent with all the other *at functions (fd before dir, instead of
dir first). I'm leaning towards keeping the signature we have, and
change fchmodat and friends to have the same style as the current
fdutimensat (dir first, because it is a *at function, then name/fd in
that order, because that is the order in which it is easiest to wrap a
non-at function to turn it in an at function).
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org