From: Timo Kokkonen Date: Sat, 14 Aug 2010 16:01:55 +0000 (+0300) Subject: main: Print warning if root priviledges are not available X-Git-Url: http://git.itanic.dy.fi/?p=scan-pagemap;a=commitdiff_plain;h=cc8fed015c81126b9a3a8e89e2feff016ba1ea8b main: Print warning if root priviledges are not available Without root priviledges, reading only the user's own processes is possible. Thus, the results usually don't contain all of the possible results. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index 502e0c3..60efb67 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include "parse.h" #include "analyze.h" @@ -76,6 +78,11 @@ int main(int argc, char *argv[]) struct process *process_list = NULL; struct parse_opts opts; + if (getuid()) { + printf("WARNING: Running without root priviledges. " + "Results may be inaccurate\n"); + } + memset(&opts, 0, sizeof(opts)); read_args(argc, argv, &opts);