[libcxx-commits] [PATCH] D91175: [19/N] [libcxx] Implement temp_directory_path using GetTempPath on windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 8 14:07:29 PST 2020


mstorsjo added inline comments.


================
Comment at: libcxx/src/filesystem/operations.cpp:1702
+    return err.report(detail::make_windows_error(GetLastError()));
+  if (retval > MAX_PATH)
+    return err.report(errc::filename_too_long);
----------------
amccarth wrote:
> My gut said `>=` rather than `>`, but the documentation for this API is a cagey about this boundary condition.  I experimented and realized this does work with `>` because there is no case where it would return exactly the buffer size.
Yeah, the return value handling there is pretty tricky - GetFinalPathNameByHandleW had the same pattern.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91175/new/

https://reviews.llvm.org/D91175



More information about the libcxx-commits mailing list