logname writes the users's login name to standard output. The login name is the string that is returned by the
getlogin(2) function. If
getlogin(2) does not return successfully, the corresponding to the real
user id of the calling process is used instead.