#elevated-privileges #process-running #unix

unix-is-elevated

check if current process is running with elevated privileges, on unix

1 unstable release

Uses new Rust 2024

0.1.0 Sep 25, 2025

#527 in Unix APIs

24 downloads per month

MIT/Apache

6KB

Check whether the running process has elevated privileges, under Unix.

The is_elevated function uses:

  • getauxval(AT_SECURE) on Linux, if available,
  • issetugid() on MacOS and *BSD,
  • getuid() != geteuid() || getgid() != getegid() as fallback.

Dependencies

~43KB