[clang-tools-extra] [flang] [llvm] [clang] [flang ]GETLOG runtime and extension implementation: get login username (PR #70917)

Kiran Chandramohan via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 22 05:55:24 PST 2023


================
@@ -37,5 +80,17 @@ void FORTRAN_PROCEDURE_NAME(getarg)(
   (void)RTNAME(GetCommandArgument)(
       n, &value, nullptr, nullptr, __FILE__, __LINE__);
 }
+
+void FORTRAN_PROCEDURE_NAME(getlog)(std::int8_t *arg, std::int64_t length) {
+  std::array<char, LOGIN_NAME_MAX + 1> str = {};
+
+  int error = getlogin_r(str.data(), str.size());
----------------
kiranchandramohan wrote:

```suggestion
  int error{getlogin_r(str.data(), str.size())};
```

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


More information about the cfe-commits mailing list