drop

Function drop 

Source
pub fn drop(mode: Mode) -> Result<(), Errno>
Expand description

Destructively change mode, preventing the process from returning. This function will set Real, Effective, and Saved values to the desired Mode. This prevents the process from changing their mode

ยงExamples

user::drop(user::Mode::Real).unwrap();
// This will only fail if we were SetUID.
if user::USER.real != user::USER.effective {
    user::set(user::Mode::Effective).expect_err("Cannot return!");
}