Added posix_getuid() to check if it is running as root