[flang-commits] [flang] [flang] Add GETCWD runtime and lowering intrinsics implementation (PR #92746)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Tue May 21 12:12:37 PDT 2024


================
@@ -239,4 +241,22 @@ std::int32_t RTNAME(GetEnvVariable)(const Descriptor &name,
   return StatOk;
 }
 
+std::int32_t RTNAME(GetCwd)(
+    const Descriptor &cwd, const char *sourceFile, int line) {
+  Terminator terminator{sourceFile, line};
+
+  RUNTIME_CHECK(terminator, IsValidCharDescriptor(&cwd));
+
+  char *buf = getcwd(nullptr, 0);
----------------
kkwli wrote:

It looks like doing that (`getcwd(nullptr, ...)`) on AIX is not recommended.
https://www.ibm.com/docs/en/aix/7.3?topic=g-getcwd-subroutine

https://github.com/llvm/llvm-project/pull/92746


More information about the flang-commits mailing list