Gets user name.
Syntax |
 |
#include <unistd.h>
char *getlogin(void);
|
Parameters |
 |
None.
Return Values |
 |
Returns a pointer to a string on success. The return values may point to static data that is overwritten by each cell.
A null pointer is returned on error or if the user's login name cannot be found.
Description |
 |
The getlogin() function returns a pointer to a string giving a user name associated with the calling process.
Implementation Considerations |
 |
The users login name string will be in the form "USER.ACCOUNT".
Errors |
 |
If an error occurs, errno is set to one of the following values:
See Also |
 |
getpwnam(), getpwuid, POSIX.1