Why does Cygwin always use absolute paths instead of OBJECT_ATTRIBUTES.RootDirectory?

Knut St. Osmundsen bird-yasm2@anduin.net
Thu Feb 5 13:58:14 GMT 2026


Experiments 10-20 years back in a different project, suggested there wasn’t any real performance gain with NTFS volumes when setting the RootDirectory handle. If I recall correctly, I think NTFS at the time would be reconstructing the volume-relative path and do the regular opening on it.  Things may have changed since then, though. I would’ve be quite curious to know how current windows performs

Anyway, it conceptually makes perfect sense to use the RootDirectory option when possible. I think we did so in the aforementioned project despite the lack of performance gains.

Cheers,
 Knut.

> On 4. Feb 2026, at 22:18, Dan Shelton via Cygwin <cygwin@cygwin.com> wrote:
> 
> Hello,
> 
> Why does Cygwin always use absolute paths instead of
> OBJECT_ATTRIBUTES.RootDirectory in NtOpenFile(),
> NtSetInformationFile() for rename and hardlinks
> 
> This slows down Cygwin path lookups a lot, and with lots of path
> elements each lookup with a relative RootDirectory might be a lot
> faster, e.g. for openat(), linkat(), renameat().
> 
> Dan
> --
> Dan Shelton - Cluster Specialist Win/Lin/Bsd
> 
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
> 



More information about the Cygwin mailing list