getlogin_r man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



getlogin(3C)							  getlogin(3C)

NAME
     getlogin, getlogin_r - get login name

SYNOPSIS
     #include <unistd.h>

     char *getlogin (void);

     int getlogin_r (char *name, size_t namelen);

DESCRIPTION
     getlogin returns a pointer to the login name as found in /var/adm/utmp.
     It 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 is called within a process that is not attached to a
     terminal, it returns a null pointer.  The correct procedure for
     determining the login name is to call cuserid, or to call getlogin and if
     it fails to call getpwuid.

     getlogin_r is a reentrant version of getlogin.  The login name is copied
     into the character array pointed to by name.  The array is namelen long
     and should have space for the name and the terminating null character.
     The maximum size of the login name is {LOGIN_NAME_MAX}.  sysconf(3C) may
     be used to determine this value.

     The following error can be returned by getlogin_r:

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

FILES
     /var/adm/utmp

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

DIAGNOSTICS
     getlogin returns a null pointer if the login name is not found.
     getlogin_r returns 0 on success or a an error number on failure.

NOTES
     The return values point to static data whose content is overwritten by
     each call.

									Page 1

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net