HPlogo MPE/iX Developer's Kit Reference Manual Volume I: HP 3000 MPE/iX Computer Systems > Chapter 4  POSIX/iX Library Function Descriptions

getlogin

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

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:

EFAULTCAUSE The system detected a NULL or bad address in attempting to allocate or access a string buffer area in which to move the user's login name.
 ACTION Report circumstances to HP.
ESYSERRCAUSE The system detected an unexpected error.
 ACTION Report circumstances to HP.

See Also

getpwnam(), getpwuid, POSIX.1

Feedback to webmaster