system_getlogin(3f) - [M_system:QUERY] get login name (LICENSE:PD)
Synopsis
Description
Return Value
Example
Author
License
function system_getlogin() result (fname)
character(len=:),allocatable :: FNAME
The system_getlogin(3f) function returns a string containing the user name associated by the login activity with the controlling terminal of the current process. Otherwise, it returns a null string and sets errno to indicate the error.
Three names associated with the current process can be determined:
o system_getpwuid(system_getuid()) returns the name associated with the real user ID of the process. o system_getpwuid(system_geteuid()) returns the name associated with the effective user ID of the process o system_getlogin() returns the name associated with the current login activity
fname returns the login name.
Sample program:
program demo_system_getlogin use M_system, only : system_getlogin implicit none character(len=:),allocatable :: name name=system_getlogin() write(*,("login[",a,"]"))name end program demo_system_getloginResults:
login[JSU]
John S. Urban
Public Domain
system_getlogin (3) | March 11, 2021 |