According to this: sysconf(3)
#include <stdio.h>
#include <unistd.h>
int main(int argc, char** argv) {
long max_usermax_group = 0;
max_group = sysconf(_SC_NGROUPS_MAX);
printf("Max group : %ld\n", max_group);
return 0;
}
in the shell :
gcc -Wall -pedantic-errors -o maxgroup maxgroup.c