Method: LinuxStat::Process.sleeping

Defined in:
lib/linux_stat/process.rb

.sleepingObject

Returns all the id of processes that are sleeping. The return type is an Array of Integers.



111
112
113
114
115
116
117
118
119
# File 'lib/linux_stat/process.rb', line 111

def sleeping
  list.select { |x|
    begin
      IO.read("/proc/#{x}/stat").split(/(\(.*\))/)[-1][/\s.+?/].strip == ?S.freeze
    rescue StandardError
      false
    end
  }
end