getlogin()

NAME

getlogin() - get login name

SYNOPSIS

#include <unistd.h>

char * getlogin(void)

DESCRIPTION

The getlogin(2) routine returns the login name of the user associated with the current process. The name is normally associated with a login shell at the time a session is created, and is inherited by all processes descended from the login shell.

Note that the login name is returned in the format

domain+logname

While all INTERIX APIs recognize the + character as a separator in a login name, Win32 programs may not. If you will be passing the returned string to a Win32 program, you may need to change the + character to a backslash (\ ).

RETURN VALUES

If a call to getlogin(2) succeeds, it returns a pointer to a null-terminated string in a static buffer. If the name has not been set, it returns NULL.

SEE ALSO

getpwnam(2)

getpwuid(2)