module Process::GID
The Process::GID module contains a collection of module functions which can be used to portably get, set, and switch the current process’s real, effective, and saved group IDs.
Public Class Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1749
def self.change_privilege: (Integer group) -> Integer
Change the current process’s real and effective group ID to that specified by group. Returns the new group ID. Not available on all platforms.
[Process.gid, Process.egid] #=> [0, 0] Process::GID.change_privilege(33) #=> 33 [Process.gid, Process.egid] #=> [33, 33]
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1763
def self.eid: () -> Integer
Returns the effective group ID for the current process:
Process.egid # => 500
Not available on all platforms.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1847
def self.eid=: (Integer group) -> Integer
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1775
def self.from_name: (String name) -> Integer
Get the group ID by the name. If the group is not found, ArgumentError will be raised.
Process::GID.from_name("wheel") #=> 0 Process::GID.from_name("nosuchgroup") #=> can't find group for nosuchgroup (ArgumentError)
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1790
def self.grant_privilege: (Integer group) -> Integer
Set the effective group ID, and if possible, the saved group ID of the process to the given group. Returns the new effective group ID. Not available on all platforms.
[Process.gid, Process.egid] #=> [0, 0] Process::GID.grant_privilege(31) #=> 33 [Process.gid, Process.egid] #=> [0, 33]
() → Integer
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1803
def self.re_exchange: () -> Integer
Exchange real and effective group IDs and return the new effective group ID. Not available on all platforms.
[Process.gid, Process.egid] #=> [0, 33] Process::GID.re_exchange #=> 0 [Process.gid, Process.egid] #=> [33, 0]
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1812
def self.re_exchangeable?: () -> bool
Returns true if the real and effective group IDs of a process may be exchanged on the current platform.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1824
def self.rid: () -> Integer
Returns the (real) group ID for the current process:
Process.gid # => 1000
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1832
def self.sid_available?: () -> bool
Returns true if the current platform has saved group ID functionality.
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/core/process.rbs, line 1844
def self.switch: () -> Integer
| [T] () { () -> T } -> T
Switch the effective and real group IDs of the current process. If a block is given, the group IDs will be switched back after the block is executed. Returns the new effective group ID if called without a block, and the return value of the block if one is given.