gid=(p1)
public
Sets the group ID for this process.
Show source
static VALUE
proc_setgid(VALUE obj, VALUE id)
{
rb_gid_t gid;
check_gid_switch();
gid = NUM2GIDT(id);
if (setresgid(gid, -1, -1) < 0) rb_sys_fail(0);
if (setregid(gid, -1) < 0) rb_sys_fail(0);
if (setrgid(gid) < 0) rb_sys_fail(0);
{
if (getegid() == gid) {
if (setgid(gid) < 0) rb_sys_fail(0);
}
else {
rb_notimplement();
}
}
return GIDT2NUM(gid);
}