staticVALUEproc_setegid(VALUEobj,VALUEegid){rb_gid_tgid;check_gid_switch();gid=NUM2GIDT(egid);#if defined(HAVE_SETRESGID)if(setresgid(-1,gid,-1)<0)rb_sys_fail(0);#elif defined HAVE_SETREGIDif(setregid(-1,gid)<0)rb_sys_fail(0);#elif defined HAVE_SETEGIDif(setegid(gid)<0)rb_sys_fail(0);#elif defined HAVE_SETGIDif(gid==getgid()){if(setgid(gid)<0)rb_sys_fail(0);}else{rb_notimplement();}#elserb_notimplement();#endifreturnegid;}