Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (g - h) getlogin_r(3)
NAME
getlogin_r - Gets login name (reentrant)
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
32-bit H-series and J-series OSS processes that do not use Standard POSIX Threads: |
/G/system/zdllnnn/zsecdll |
64-bit H-series and J-series OSS processes that do not use Standard POSIX Threads: |
/G/system/zdllnnn/ysecdll |
H-series and J-series OSS processes that use the Standard POSIX Threads Library:
/G/system/zdllnnn/zsptdll
(See NOTES)
SYNOPSIS
#include <unistd.h>
[#include <spthread.h>] /* Required if using Standard POSIX Threads Library */
int getlogin_r (
char *name,
size_t namesize);
PARAMETERS
name Points to the buffer where the login name is stored.
namesize Specifies the size of the buffer passed in bytes.
DESCRIPTION
The getlogin_r( ) function is the reentrant version of the getlogin( ) function.
The getlogin_r( ) function puts the name associated by the login activity with the controlling ter-
minal of the current process in the character array pointed to by the name parameter. The array is
namesize characters long and should have space for the name and the terminating null character.
The maximum size of the login name is LOGIN_NAME_MAX.
If the call to getlogin_r( ) is successful, name points to the name the user used at login, even if
there are several login names with the same user ID.
The login name can be a username or a user alias.
The name is normally associated with a login shell at the time a session is created, and it is inher-
ited by all processes descended from the login shell. (This association is true even if some of
those processes assume another user ID.)
NOTES
On systems running H06.21 or later H-series RVUs or J06.10 or later J-series RVUs, you can use
either the POSIX User Thread Model Library or the Standard POSIX Threads Library for
threaded applications.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, if you are |
NOT using the Standard POSIX Threads Library (this is not a threaded application or you are |
using the POSIX User Thread Model Library) you can use this function with 32-bit or 64-bit OSS |
applications.
If you are NOT using the Standard POSIX Threads Library (this is not a threaded application or
you are using the POSIX User Thread Model Library), you must:
Include the unistd.h header file
527187-017 Hewlett-Packard Company 377