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());


        
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to