Page MenuHomePhabricator

[14/N] [libcxx] Implement the current_path function for windows
Needs ReviewPublic

Authored by mstorsjo on Tue, Nov 10, 8:35 AM.

Details

Reviewers
amccarth
EricWF
Group Reviewers
Restricted Project

Diff Detail

Event Timeline

mstorsjo created this revision.Tue, Nov 10, 8:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Nov 10, 8:35 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
amccarth added inline comments.Wed, Dec 2, 4:53 PM
libcxx/src/filesystem/operations.cpp
1139

Is _wgetcwd the right choice here? Shouldn't this instead go straight to Windows with GetCurrentDirectoryW so it doesn't take a dependence on MSVC's CRT?

mstorsjo added inline comments.Thu, Dec 3, 5:09 AM
libcxx/src/filesystem/operations.cpp
1139

I guess we could do that as well; we still have a few other calls that go through the CRT (in the FileDescriptor helper class further up in the file, used for file copying), and in this case, there's no other practical limitation in _wgetcwd that we'd get around, other than cleanliness. (Calling GetCurrentDirectoryW takes two calls and manual allocation inbetween, unless we want to hardcode a PATH_MAX allocation, but I'd rather move away from such specific limits.)

But yeah I can change it if you still prefer that.