《Linux函数调用手册》之___getgrnam从组文件中取得指定组的数据
定义:
strcut group * getgrnam(const char * name);
表头文件:
#include<grp.h>
#include<sys/types.h>
说明:
getgrnam()用来逐一搜索参数那么指定的组名称, 找到时便将该组的数据以group结构返回。group结构请参考getgrent()。
返回值:
返回group结构数据, 如果返回NULL则表示已无数据, 或有错误发生。
相关函数:
fgetgrent, getrent, getgruid
示例:
执行:
adm:x:4:root,adm,daemon
返回顶部 | 《Linux函数调用大全》 | 《Linux命令大全》 | Linux专栏