码迷,mamicode.com
首页 > 其他好文 > 详细

day4

时间:2015-11-07 17:24:52      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

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;

}

 

两个函数的结果返回????????????????

day4

标签:

原文地址:http://www.cnblogs.com/degrone/p/4945608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!