by getpwent(), getpwnam() & getpwuid() --- but not the other way around. This requires that cuserid() have its own static buffer.
getlogin() and cuserid() do very different things, getlogin() is POSIX, while cuserid() is not (it was removed in the 1990 revision).