[llvm-branch-commits] [libcxx] 92bb81a - [SystemZ][ZOS] Provide PATH_MAX macro for libcxx
Zbigniew Sarbinowski via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Jan 23 16:34:07 PST 2021
Author: Zbigniew Sarbinowski
Date: 2021-01-24T00:29:39Z
New Revision: 92bb81aac1f16e2e9633d101b8b3f83d9c91dd48
URL: https://github.com/llvm/llvm-project/commit/92bb81aac1f16e2e9633d101b8b3f83d9c91dd48
DIFF: https://github.com/llvm/llvm-project/commit/92bb81aac1f16e2e9633d101b8b3f83d9c91dd48.diff
LOG: [SystemZ][ZOS] Provide PATH_MAX macro for libcxx
Defining PATH_MAX to _XOPEN_PATH_MAX which is the closest macro available on z/OS.
Note that this value is 1024 which is 4 times smaller from same macro on Linux.
Reviewed By: #libc, ldionne, hubert.reinterpretcast
Differential Revision: https://reviews.llvm.org/D92110
Added:
Modified:
libcxx/src/filesystem/operations.cpp
Removed:
################################################################################
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index 7db2d1ff0074..50a895dc2fae 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -634,7 +634,11 @@ path __canonical(path const& orig_p, error_code* ec) {
return err.report(capture_errno());
return {hold.get()};
#else
- char buff[PATH_MAX + 1];
+ #if defined(__MVS__) && !defined(PATH_MAX)
+ char buff[ _XOPEN_PATH_MAX + 1 ];
+ #else
+ char buff[PATH_MAX + 1];
+ #endif
char* ret;
if ((ret = ::realpath(p.c_str(), buff)) == nullptr)
return err.report(capture_errno());
More information about the llvm-branch-commits
mailing list