The system utility gEnqSysUsername() returns an appropriate user name of the current application. In most multi-user implementations, the login name is returned, but in single user systems, such as PC's, an implementation dependent string is returned.
The C/C++ binding returns the user name either in the string uname of length slen or (if uname is NULL) as a pointer to a character string that has been malloc'ed internally and which should be freed after use with the function free. In the Fortran 90 binding the user name is returned in the character argument uname. If this is not large enough to contain the user name it will be truncated.