[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) July 05, 2020
Generated by manServer 1.08 from 834784f0-5440-40e0-93f1-5d5dfd2bf979 using man macros.