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.initgroups

Process.initgroups(username, gid) → array

Initializes the supplemental group access list by reading the system group database and using all groups of which the given user is a member. The group with the specified gid is also added to the list. Returns the resulting Array of the GIDs of all the groups in the supplementary group access list. Not available on all platforms.

Example
Process.groups   #=> [0, 1, 2, 3, 4, 6, 10, 11, 20, 26, 27]
Process.initgroups( "mgranger", 30 )   #=> [30, 6, 10, 11]
Process.groups   #=> [30, 6, 10, 11]
See also .groups= .kill .groups .last_status also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0