bug-gnulib
[Top][All Lists]
Advanced

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

Re: basing *at functions over openat when available?


From: Eric Blake
Subject: Re: basing *at functions over openat when available?
Date: Thu, 24 Sep 2009 06:15:45 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Paolo Bonzini on 9/24/2009 12:26 AM:
> It seems to me that we took a backwards approach with mingw
> implementations of the *at functions.
> 
> Mingw is perfectly able to implement both fchmod and openat via NTDLL
> functions (NtSetInformationFile and NtCreateFile/NtOpenFile).  While
> underdocumented, these functions _are_ stable and are used for example
> by Cygwin.

Patches welcome, although I probably won't be spending time on it.

> 
> While looking at it, I was surprised that there is no support for
> implementing fchmodat on top of openat+fchmod.  Are there POSIX systems
> that only implement openat and possibly O_NOFOLLOW?  In this case, a
> version of at-func.c supporting those systems would be nice to have.

So far, every known system either lacks openat, or already provides both
openat and fchmodat.  And of the systems that provide fchmodat, I think
(but am not 100% positive) that either fchmodat(,O_SYMLINK_NOFOLLOW) works
and lchmod is present, or there is no way to change symlink mod bits.

I think the same goes for openat/fchownat.

More interesting will be implementing utimensat, where there are indeed
systems with openat and futimes where that may be the best fallback.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq7YvEACgkQ84KuGfSFAYCrcgCeJSXnmlal9IjXdZNdlbqrVlOt
2wUAn0JNusfjWS3Kly1TtHIBwlVaiFi0
=U6Wc
-----END PGP SIGNATURE-----




reply via email to

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