标签:passwd type user 获取文件 get c函数 记录 函数 ==
#include <pwd.h>
#include<sys/types.h>
#include<unistd.h>
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);
标签:passwd type user 获取文件 get c函数 记录 函数 ==
原文地址:https://www.cnblogs.com/fogcell/p/8806773.html