[all-commits] [llvm/llvm-project] 1773ee: [libcxx] Implement semaphores for windows

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Mar 5 00:49:29 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1773eec6928f4e37b377e23b84d7a2a07d0d1d0d
      https://github.com/llvm/llvm-project/commit/1773eec6928f4e37b377e23b84d7a2a07d0d1d0d
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-05 (Fri, 05 Mar 2021)

  Changed paths:
    M libcxx/include/__threading_support
    M libcxx/src/support/win32/thread_win32.cpp

  Log Message:
  -----------
  [libcxx] Implement semaphores for windows

Also add WIN32_LEAN_AND_MEAN before including windows.h, for consistency
with other sources.

Differential Revision: https://reviews.llvm.org/D97539


  Commit: 99c7b532946508efcf6cd978d86ee24b2a66d096
      https://github.com/llvm/llvm-project/commit/99c7b532946508efcf6cd978d86ee24b2a66d096
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-05 (Fri, 05 Mar 2021)

  Changed paths:
    M libcxx/src/filesystem/operations.cpp
    M libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp

  Log Message:
  -----------
  [libcxx] Avoid infinite recursion in create_directories, if the root directory doesn't exist

Differential Revision: https://reviews.llvm.org/D97618


  Commit: 29012ce986fcb24175f19317b4e2d119cd8cdbb2
      https://github.com/llvm/llvm-project/commit/29012ce986fcb24175f19317b4e2d119cd8cdbb2
  Author: Martin Storsjö <martin at martin.st>
  Date:   2021-03-05 (Fri, 05 Mar 2021)

  Changed paths:
    M libcxx/src/filesystem/operations.cpp

  Log Message:
  -----------
  [libcxx] Map ERROR_BAD_PATHNAME to errc::no_such_file_or_directory on windows

Opening a path like \\server (without a trailing share name and
path) produces this error, while opening e.g. \\server\share
(for a nonexistent server/share) produces ERROR_BAD_NETPATH (which
already is mapped).

This happens in some testcases (in fs.op.proximate); as proximate()
calls weakly_canonical() on the inputs, weakly_canonical() checks
whether the path exists or not. When the error code wasn't recognized
(it mapped to errc::invalid_argument), the stat operation wasn't
conclusive and weakly_canonical() errored out. With the proper error
code mapping, this isn't considered an error, just a nonexistent
path, and weakly_canonical() can proceed.

This roughly matches what MS STL does - it doesn't have
ERROR_BAD_PATHNAME in its error code mapping table, but it
checks for this error code specifically in the return of their
correspondence of the stat function.

Differential Revision: https://reviews.llvm.org/D97619


Compare: https://github.com/llvm/llvm-project/compare/579fd0259788...29012ce986fc


More information about the All-commits mailing list