egid=(p1)
public
Sets the effective group ID for this process. Not available on all
platforms.
Show source
static VALUE
proc_setegid(VALUE obj, VALUE egid)
{
rb_gid_t gid;
check_gid_switch();
gid = OBJ2GID(egid);
if (setresgid(-1, gid, -1) < 0) rb_sys_fail(0);
if (setregid(-1, gid) < 0) rb_sys_fail(0);
if (setegid(gid) < 0) rb_sys_fail(0);
if (gid == getgid()) {
if (setgid(gid) < 0) rb_sys_fail(0);
}
else {
rb_notimplement();
}
rb_notimplement();
return egid;
}