cuserid(S) 6 January 1993 cuserid(S) Name cuserid - get character login name of the user Syntax cc . . . -lc #include <stdio.h> char *cuserid (s) char *s; Description The cuserid routine creates a character-string of the login name that the owner of the current process is logged in under. If s is a NULL pointer, this string is generated in an internal static area, the address of which is returned by cuserid. Otherwise, the string is left in the array, assumed to contain at least Lcuserid characters, to which s points. The constant Lcuserid is defined in the <stdio.h> header file. Return value If the argument s is not NULL and the routine is successful, cuserid returns s. If s is NULL, the routine returns the address where the string is internally stored. If the login name is not found and s is NULL, cuserid returns a NULL pointer. If the login name is not found and s is not NULL, a null character('\0') will be placed in s[0] and s is returned by cuserid. Note When s is NULL, as mentioned above, the string is stored in an internal static area whose contents are overwritten by each call to cuserid. The cuserid routine uses the getpwuid routine, and therefore the results of a getpwuid or a getpwnam routine may be destroyed by a subsequent call to cuserid. See also getlogin(S), getpwent(S) Standards conformance cuserid conforms with: X/Open Portability Guide, Issue 3, 1989; IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1); and NIST FIPS 151-1.