pub fn uid() -> u32
unix_process_user_group_ids
Returns the real user ID of the current process.
#![feature(unix_process_user_group_ids)] use std::os::unix::process; fn main() { let uid = process::uid(); println!("The current process has UID {}", uid); }