setregid(p1, p2)
public
Sets the (group) real and/or effective group IDs of the current process to
rid and eid, respectively. A value of -1 for either means
to leave that ID unchanged. Not available on all platforms.
Show source
static VALUE
p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
{
rb_gid_t rgid, egid;
PREPARE_GETGRNAM;
check_gid_switch();
rgid = OBJ2GID(rid);
egid = OBJ2GID(eid);
FINISH_GETGRNAM;
if (setregid(rgid, egid) != 0) rb_sys_fail(0);
return Qnil;
}