标签:
int is_his_file(char*filename,char *username)
{
int ret;
struct passwd *user_info;//
struct stat stat_info;
user_info=getpwnam(username);//获取用户信息
if(user_info==NULL)
{
printf("can not find this user\n");
exit(-1);
}
stat(filename,&stat_info);
if(stat_info.st_uid==user_info->pw_uid)
return 0;
else
return -1;
}
两个函数的结果返回????????????????
标签:
原文地址:http://www.cnblogs.com/degrone/p/4945608.html