Current-Users archive

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

Re: utimensat

On Tue, Aug 28, 2012 at 08:20:23AM +0000, Emmanuel Dreyfus wrote:
> On Tue, Aug 28, 2012 at 09:57:56AM +0200, Thomas Klausner wrote:
> > Why are utimensat and fstatat hidden and only available if
> Because our implementation is incomplete and therefore not 
> Standard-compliant: We only support the case where fs is AT_FDCWD.
> Supporting the whole C063 function family require modifications 
> to our namei implementation, so that you can give it a path rooted 
> from a directory file descriptor. I remeber someone was about to do it
> some time ago, but I am not sure it happened.
> It is possible to workaround incomplete utimensat(fd, path, ns, flags) 
> with fd != AT_FDCWD by something like this (not tested):
>       old_fd = open(".", O_RDONLY, 0);
>       chdir(fd);
>       utimensat(AT_FDCWD. path, ns, flags)
>       chdir(old_fd);
>       close(old_fd);

Except that doesn't work for threaded programs, and doesn't work
if you don't have read access to ".".

As such it is likely to only confuse things.
About as useful as code that attempts to implement pread() using lseek().


David Laight:

Home | Main Index | Thread Index | Old Index