Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ getlogin(3C) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

reentrant(3)

cuserid(3S)

getgrent(3C)

getpwent(3C)

utmp(4)



getlogin(3C)                   DG/UX 5.4R3.00                   getlogin(3C)


NAME
       getlogin, getloginr - get login name

SYNOPSIS
       #include <stdlib.h>

       char *getlogin (void);

       char *getloginr (char *name, int namelen);

DESCRIPTION
       getlogin and getloginr return a pointer to the login name as found
       in /etc/utmp.  Instead of returning static data, getloginr returns
       the login name into the location pointed to by name. The return value
       from getloginr is  the same value as name.  namelen is the maximum
       number of characters in name.  If getloginr detects an error, a NULL
       is returned and errno is set to indicate the error.  Both functions
       may be used in conjunction with getpwnam to locate the correct
       password file entry when the same user id is shared by several login
       names.

       If getlogin or getloginr are called within a process that is not
       attached to a terminal, both return a null pointer.  This is the case
       for processes started at the system console.  The correct procedure
       for determining the login name is to call cuserid, or to call
       getlogin or getloginr and if it fails to call getpwuid.


   Considerations for Threads Programming
                    +-----------+-----------------------------+
                    |           |                      async- |
                    |function   | reentrant   cancel   cancel |
                    |           |              point    safe  |
                    +-----------+-----------------------------+
                    |getlogin   |     N          -        -   |
                    |getloginr |     Y          Y        N   |
                    +-----------+-----------------------------+

FILES
       /etc/utmp

SEE ALSO
       reentrant(3), cuserid(3S), getgrent(3C), getpwent(3C), utmp(4).

DIAGNOSTICS
       Both functions return a null pointer if the login name is not found.

   Errors
       If the following condition occurs, getloginr returns a NULL
        and sets errno to the corresponding value:

       [ERANGE]  The value of namelen is smaller than the length of the
                 string to be returned.




Licensed material--property of copyright holder(s)                         1




getlogin(3C)                   DG/UX 5.4R3.00                   getlogin(3C)


NOTES
       The function getloginr is available only in the library, libc.so.

       getlogin returns a pointer to static data whose content is
       overwritten by each call.




















































Licensed material--property of copyright holder(s)                         2


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026