groups()
public
Show source
static VALUE
proc_getgroups(VALUE obj)
{
VALUE ary;
int i, ngroups;
rb_gid_t *groups;
groups = ALLOCA_N(rb_gid_t, maxgroups);
ngroups = getgroups(maxgroups, groups);
if (ngroups == -1)
rb_sys_fail(0);
ary = rb_ary_new();
for (i = 0; i < ngroups; i++)
rb_ary_push(ary, GIDT2NUM(groups[i]));
return ary;
}