move getgroups to generic code
note on size for getgroups