getlogin()

Get the user name associated with the calling process

Synopsis:

#include <unistd.h>

char* getlogin( void );

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

This function is in libc.a, but not in libc.so (in order to save space).

Description:

The getlogin() function returns a pointer to a string containing the login name of the user associated with the calling process.

Returns:

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.

Classification:

POSIX 1003.1

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread No

Last modified: 2013-12-23

comments powered by Disqus