Function get_own_username

Source
fn get_own_username<U: PwdGrpProvider>(userdb: &U) -> Result<Option<Vec<u8>>>
Available on target_family="unix" and non-iOS and non-Android and non-tvOS only.
Expand description

Find our username, if possible.

By default, we look for the USER environment variable, and see whether we an find a user db entry for that username with a UID that matches our own.

Failing that, we look for a user entry for our current UID.