Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Process.getsid

Process.getsid(pid = nil) → integer

Returns the session ID of the given process ID pid, or of the current process if not given:

Example
Process.getsid                # => 27422
Process.getsid(0)             # => 27422
Process.getsid(Process.pid()) # => 27422

Not available on all platforms.

See also .getrlimit .gid .getpriority .gid= also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0