![]() |
![]() |
![]() |
Get the user name associated with the calling process
#include <unistd.h> char* getlogin( void ) ;
libc
The getlogin() function returns a pointer to a string containing the login name of the user associated with the calling process.
A pointer to a string containing the user's login name, or NULL if the user's login name can't be found.
The return value from getlogin() may point to static data and, therefore, may be overwritten by each call.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | No |
getlogin_r(), getpwnam(), getpwuid()
![]() |
![]() |
![]() |