Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Process::UID.switch

Process::UID.switch → integer
Process::UID.switch {|| block} → object

Switch the effective and real user IDs of the current process. If a block is given, the user IDs will be switched back after the block is executed. Returns the new effective user ID if called without a block, and the return value of the block if one is given.

See also .sid_available? .rid also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0