CUSERID(3) BSD Library Functions Manual CUSERID(3)
cuserid -- get user name
Compatibility Library (libcompat, -lcompat)
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
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.
If buf is not the NULL pointer, buf is returned; otherwise the address of the static buffer is returned.
If the user name could not be determined, if buf is not the NULL pointer, the null character '