This interface is available from the compatibility library, libcompat and has been obsoleted by
getlogin(2).
The
cuserid() function returns a character string representation of the user name associated with the effective user ID of the calling process.
If
buf is not the
NULL pointer, the user name is copied into the memory referenced by
buf. The argument
buf is assumed to point to an array at least
L_cuserid (as defined in the include file
<stdio.h>) bytes long. Otherwise, the user name is copied to a static buffer.