-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[flang] GETLOG runtime and extension implementation: get login username #74628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Get login username, ussage: CHARACTER(32) :: login CALL getlog(login) WRITE(*,*) login
accourding to https://linux.die.net/man/3/getlogin_r, `_REENTRANT || _POSIX_C_SOURCE >= 199506L` checks the existance of getlogin_r
take copyBufferAndPad() out of anonymous namespace, so it can be called in other places.
Co-authored-by: Kiran Chandramohan <[email protected]>
Co-authored-by: Kiran Chandramohan <[email protected]>
This reverts commit fb910d1.
…ace" This reverts commit a1b1b66.
The compiler must have access to the implementations of templated functions at the points where they're instantiated.
…restore CopyAndPad Suggested: https://man.archlinux.org/man/getlogin_r.3.en For most purposes, it is more useful to use the environment variable LOGNAME to find out who the user is. This is more flexible precisely because the user can set LOGNAME arbitrarily. POSIX specification: LOGNAME The system shall initialize this variable at the time of login to be the user's login name. Note that at this point, this implementation might not work on Windows
accidently push the wrong branch in previous pr #70917 |
#70917 (comment) |
…_r, and restore CopyAndPad" This reverts commit 266a269.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @jeanPerier Sorry to throw a ping. I have changed the structure and implementation of
Proper test has been added on both Linux and Windows for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Described logic in your comment looks good to me. I have two comments regarding the implementation.
✅ With the latest revision this PR passed the C/C++ code formatter. |
Windows CI failure: compiler out of heap space. |
This patch broke the Solaris build:
and
As documented in Solaris
So the code needs to fall back to I've used the attached patch to implement this, which allowed the build and |
Thanks for reporting and providing a fix for this. I do not have a Solaris instance on hand to test it, so if you don't mind, could you send this out as a pull request? |
Sure: I've just created one slightly changed from the attached patch: [flang] Handle missing LOGIN_NAME_MAX definition in runtime |
Get login username, ussage:
getlog is required for an exascale proxyapp.
https://proxyapps.exascaleproject.org/app/minismac2d/
https://github.com/Mantevo/miniSMAC/blob/f90446714226eeef650b78bce06ca4967792e74d/ref/smac2d.f#L615
https://github.com/Mantevo/miniSMAC/blob/f90446714226eeef650b78bce06ca4967792e74d/ref/smac2d.f#L1570