Fix std::filesystem

This change makes a second pass, at fixing the errno issue with libcxx's
filesystem code. Previously, 89.01% of LLVM's test suite was passing and
now 98.59% of their tests pass. Best of all, it's now possible for Clang
to be built as a working APE binary that can to compile the Cosmopolitan
repository. Please note it has only been vetted so far for some objects,
and more work would obviously need to be done in cosmo, to fix warnings.
This commit is contained in:
Justine Tunney 2024-07-28 17:25:20 -07:00
parent 0d7c272d3f
commit 77d3a07ff2
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
14 changed files with 408 additions and 69 deletions

View file

@ -98,16 +98,9 @@ inline errc __win_err_to_errc(int err) {
#endif // _LIBCPP_WIN32API
errc __cosmo_err_to_errc(int);
int __cosmo_errc_to_err(errc);
inline error_code capture_errno() {
_LIBCPP_ASSERT_INTERNAL(errno != 0, "Expected errno to be non-zero");
#ifdef __COSMOPOLITAN__
return error_code((int)__cosmo_err_to_errc(errno), generic_category());
#else
return error_code(errno, generic_category());
#endif
return error_code((int)__err_to_errc(errno), generic_category());
}
#if defined(_LIBCPP_WIN32API)