Method: LinuxStat::ProcessInfo.state

Defined in:
lib/linux_stat/process_info.rb

.state(pid = $$) ⇒ Object

state(pid = $$)

Returns the state of the process as a frozen String

  • A process could have multiple states:

  1. S => Sleeping

  2. R => Running

  3. I => Idle

  4. Z => Zombie

It returns any one of them.

If the info isn’t available or the argument passed doesn’t exist as a process ID, it will return an empty String.



567
568
569
# File 'lib/linux_stat/process_info.rb', line 567

def state(pid = $$)
	LinuxStat::ProcFS.ps_state(pid)
end