[Top][All Lists]

[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:37:34 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

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             address@hidden
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/


reply via email to

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