PSX_CUSERID
Get the username
Description:
This routine will get a username associated with
the effective user ID of the current process. If the username cannot be found, a blank string is
returned.
Invocation
CALL PSX_CUSERID( USER, STATUS )
Arguments
USER = CHARACTER
(
)
(Returned)
The username
STATUS = INTEGER (Given)
The global status.
Notes:
-
On a Unix system the translation from effective user ID to username is performed. Since there can be
several usernames associated with a user ID, there is no guarantee that the value returned will be
unique.
-
The Unix function cuserid is no longer in the IEEE 1003.1-1990 standard, so an alternative to this
routine should be used.
-
If the first attempt to get the username fails, one more attempt is made. This overcomes an occasional
(timing?) problem on Linux.
External Routines Used
cnf: cnfExprt
References
Copyright
Copyright (C) 1991 Science & Engineering
Research Council
Copyright © 2000 Council for the Central Laboratory of the Research Councils, 2006 Particle Physics
and Astronomy Research Council