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

Yi Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 05:35:50 PST 2023


yi-wu-arm wrote:

Hi @jeanPerier Sorry to throw a ping. I have changed the structure and implementation of `getlog`, it now does the following:
On Linux: use `getlogin_r`, if fail get from environment variable. 
On Windows: get from environment variable to avoid linking to library `Advapi32.lib`.
Username will be pad with spaces as how gfortran does it.
e.g.
```
loginName    XXXXX       <--------- if length is longer than name, pad with space
loginNameXXXX            <--------- just right
logiXXXX                 <--------- if shorter still fill with name
```
Proper test has been added on both Linux and Windows for `getlog_r` and environment variable.

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


More information about the cfe-commits mailing list