[clang] [llvm] [clang-tools-extra] [flang] [flang] GETLOG runtime and extension implementation: get login username (PR #74628)
Peter Klausler via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 13 07:23:21 PST 2023
================
@@ -10,13 +10,29 @@
// extensions that will eventually be implemented in Fortran.
#include "flang/Runtime/extensions.h"
+#include "flang/Runtime/character.h"
#include "flang/Runtime/command.h"
#include "flang/Runtime/descriptor.h"
#include "flang/Runtime/io-api.h"
+#if _REENTRANT || _POSIX_C_SOURCE >= 199506L
+// System is posix-compliant and has getlogin_r
+#include <unistd.h>
+#endif
+
extern "C" {
namespace Fortran::runtime {
+
+void GetUsernameEnvVar(
+ const char *envName, std::byte *arg, std::int64_t length) {
+ Descriptor name{
+ *Descriptor::Create(1, sizeof(envName), const_cast<char *>(envName), 0)};
----------------
klausler wrote:
Exactly.
https://github.com/llvm/llvm-project/pull/74628
More information about the cfe-commits
mailing list