#include <pwd.h>
#include<sys/types.h>
#include<unistd.h>ui
if (geteuid() == 0) { LOGI("running from root user"); } struct passwd *pw = getpwuid(getuid()); const char *homedir = pw->pw_dir;
fseek(f, 0, SEEK_END); long pos = ftell(f); fseek(f, 0, SEEK_SET);