I am implementing a custom syscall in Linux kernel and need to check if a process is running as superuser. I am using getuid() function like this:
#include <linux/unistd.h>
if (getuid() == 0) {
...
}
However, when I compile I'm getting the error error: implicit declaration of function 'getuid' [-Werror=implicit-function-declaration]
.
I thought this would only be an issue if it can't find the header file, but I am including it, so I'm not sure where to go. Any ideas?