

getlogin()               General Function              getlogin()




Get login name

cchhaarr *ggeettllooggiinn()

The name  corresponding to the current user id  is not always the
same as the name under which a user logged into the COHERENT sys-
tem.   For example,  the user  may have issued  a su  command, or
there may be several login names associated with a user id.  get-
login returns the login name found in the file /etc/utmp.

In  cases where  getlogin  fails to  produce  a result,  getpwuid
(described in  getpwent) is normally  used to determine  the user
name for a process.

***** Files *****

/eettcc/uuttmmpp  login names

***** See Also *****

general functions,  getpwent(), getuid(), su,  ttyname(), utmp.h,
who

***** Diagnostics *****

getlogin returns NULL if the login name cannot be determined.

***** Notes *****

getlogin  stores  the returned  name  in a  static  area that  is
destroyed by subsequent calls.

























COHERENT Lexicon                                           Page 1


