Next: PSX_FREE - Free virtual memory
Up: Routine Descriptions
Previous: PSX_CTIME - Convert the calendar time to a character string
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
- POSIX standard (1988), section 4.2.4
-
Copyright
- Copyright (C) 1991 Science & Engineering Research Council
Next: PSX_FREE - Free virtual memory
Up: Routine Descriptions
Previous: PSX_CTIME - Convert the calendar time to a character string
PSX POSIX interface routines
Starlink User Note 121
P M Allan
A J Chipperfield
10 April 2003
E-mail:ussc@star.rl.ac.uk
Copyright © 2000 Council for the Central Laboratory of the Research Councils