[UP]


Manual Reference Pages  - system_getlogin (3)

NAME

system_getlogin(3f) - [M_system:QUERY] get login name (LICENSE:PD)

CONTENTS

Synopsis
Description
Return Value
Example
Author
License

SYNOPSIS

function system_getlogin() result (fname)

   character(len=:),allocatable :: FNAME

DESCRIPTION

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

RETURN VALUE

fname
  returns the login name.

EXAMPLE

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_getlogin

Results:

   login[JSU]

AUTHOR

John S. Urban

LICENSE

Public Domain


system_getlogin (3) March 11, 2021
Generated by manServer 1.08 from 68886a47-f56b-4474-9118-db9cf6da5d06 using man macros.