Sets the (group) real, effective, and saved user IDs of the current process
to rid,eid, and sid respectively. A value of -1
for any value means to leave that ID unchanged. Not available on all
platforms.
static VALUE
p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
{
rb_gid_t rgid, egid, sgid;
PREPARE_GETGRNAM;
check_gid_switch();
rgid = OBJ2GID(rid);
egid = OBJ2GID(eid);
sgid = OBJ2GID(sid);
FINISH_GETGRNAM;
if (setresgid(rgid, egid, sgid) != 0) rb_sys_fail(0);
return Qnil;
}