bakane
bakane
CC#
Created by bakane on 6/26/2024 in #help
How to check if program is running as root on Linux
I need my program to be run as sudo to function, so I want to exit if it's not. How can I check if the program is running as root? I can't find any method that gets you the euid.
7 replies