#include #include #include int group_member(gid_t gid) { gid_t *grouplist = NULL; int res,i; res = getgroups(0,NULL); if (res >= 0) { grouplist = calloc(sizeof(gid_t),res); res = getgroups(res,grouplist); if (res >=0) { for(i=0;i