[libcxx-commits] [PATCH] D153037: [libcxx] Migrate posix_compat.h layer to not use CRT filesystem functions.
James Y Knight via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 5 06:27:59 PDT 2023
jyknight added inline comments.
================
Comment at: libcxx/src/filesystem/file_descriptor.h:127-138
+ // TODO: most of the filesystem implementation uses native Win32 calls
+ // (mostly via posix_compat.h). However, here we use the C-runtime APIs to
+ // open a file, because we subsequently pass the C-runtime fd to
+ // `std::[io]fstream::__open(int fd)` in order to implement copy_file.
+ //
+ // Because we're calling the windows C-runtime, win32 error codes are
+ // translated into C error numbers by the C runtime, and returned in errno,
----------------
ldionne wrote:
> Is there anything blocking us from doing this now? I'm a bit concerned that this patch is adding a TODO without much of an intent to remove it (unless I'm mistaken).
There is nothing blocking it, other than someone's time to work on it. I was indeed not planning to volunteer to do it at the moment, but would be happy if someone else wants to tackle it.
(I'll also note that CopyFile2 ought to be used on windows, regardless; the TODO just documents that deficiency).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153037/new/
https://reviews.llvm.org/D153037
More information about the libcxx-commits
mailing list