Adi*_*GuN 6 c linux usergroups
我想知道unix命令组是否还有其他C库,
$ groups ---- lists all the group id's of the user.
有一个名为getgroups()的方法,但此方法将返回用户组。有没有一种方法可以使用C为特定用户获取组。
#include "<grp.h>"
int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups);
Run Code Online (Sandbox Code Playgroud)