[][src]Function users::switch::set_effective_uid

pub fn set_effective_uid(uid: uid_t) -> IOResult<()>

Sets the effective user for the running process to the one with the given user ID.

Typically, trying to switch to anyone other than the user already running the process requires root privileges.

libc functions used

Examples

use users::switch::set_effective_uid;

set_effective_uid(1001);
// current effective user ID is 1001