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

Yi Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 6 09:04:16 PST 2023


yi-wu-arm wrote:

CI didn't pass because `getlogin_r` fail on Linux with error code 6.
```
ENXIO
The calling process has no controlling terminal.
```
https://man.archlinux.org/man/getlogin_r.3.en#EMFILE suggested using environment variable rather than use `getlogin` or `getlogin_r`.
Thus, the implementation of `getlog` intrinsics has changed: get username by calling `GetEnvVriable` runtime function.
On WIndows, use environment variable `USERNAME`.
On Linux, use environment variable `LOGNAME`.

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


More information about the cfe-commits mailing list