-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Eric Blake on 9/24/2009 6:15 AM: > 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.
P.S. The Cygwin developers discovered that NtCreateFile/NtOpenFile, when used to open a relative file, has quadratic behavior in the length of the absolute file name being opened, in Windows XP and earlier; this time is attributed to the system call and not the application. Microsoft fixed it to have linear performance on relative names in newer versions of Windows, and even acknowledged the bug in earlier versions, but is not going to address it. So even if we implemented openat with these functions, it would not add any speed to super-long paths under mingw on older Windows. Also, cygwin's current implementation of *at is still textual (convert relative POSIX names into an absolute w32 name) rather than using the relative Nt* features, meaning that cygwin's openat() is still quadratic in the length of the absolute file name even on newer Windows. Yes, there are plans to use the relative features of NtCreateFile in the future, but cygwin is not yet using them for a more efficient openat. - -- Don't work too hard, make some time for fun as well! Eric Blake e...@byu.net -----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/ iEYEARECAAYFAkq7aA4ACgkQ84KuGfSFAYBCbQCfdiJVpoMwt6om/3qNuakox6VV dUcAn2bP3mO5E/4GlaO/5HtZ8UWkZhb0 =mXr3 -----END PGP SIGNATURE-----