/* this tests whether getgroups actually returns lists of integers rather than gid_t. The test only works if the user running the test is in at least 1 group The test is designed to check for those broken OSes that define getgroups() as returning an array of gid_t but actually return a array of ints! Ultrix is one culprit */ #if defined(HAVE_UNISTD_H) #include #endif #include #include #include #include int main(void) { int i; int *igroups; char *cgroups; int grp = 0; int ngroups = getgroups(0,&grp); if (sizeof(gid_t) == sizeof(int)) { fprintf(stderr,"gid_t and int are the same size\n"); exit(1); } if (ngroups <= 0) ngroups = 32; igroups = (int *)malloc(sizeof(int)*ngroups); for (i=0;i