Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

getlogin - Query user ID

&pagelevel(4)&pagelevel

Definition  

#include <stdlib.h>

char *getlogin(void);

getlogin returns the login name (i.e. userid) under which the calling program is being
executed.

Return val.

Pointer to the name of the user id.

Note

getlogin writes its result into an internal C data area that is overwritten with each call!

Example

Pointer to the name of the user id.

getlogin writes its result into an internal C data area that is overwritten with each call!

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
  printf("Example showing the use of getlogin():\n");
  printf("Userid = %s\n", getlogin());
  return 0;
}