Method: Process::UID#switch
- Defined in:
- process.c
#switch ⇒ Object (private)
7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 |
# File 'process.c', line 7231
static VALUE
p_uid_switch(VALUE obj)
{
rb_uid_t uid, euid;
check_uid_switch();
uid = getuid();
euid = geteuid();
if (uid == euid) {
rb_syserr_fail(EPERM, 0);
}
p_uid_exchange(obj);
if (rb_block_given_p()) {
under_uid_switch = 1;
return rb_ensure(rb_yield, Qnil, p_uid_sw_ensure, obj);
}
else {
return UIDT2NUM(euid);
}
}
|