Sha256: ebefcc3c4a9acc60cbc9fc0fc031108e43e4d74a6c951333f0414a20ff4570a1
Contents?: true
Size: 574 Bytes
Versions: 39
Compression:
Stored size: 574 Bytes
Contents
# frozen_string_literal: true require 'ffi' module Facter module Util module Resolvers module Ffi module LoadAverages extend ::FFI::Library ffi_lib ::FFI::Library::LIBC attach_function :getloadavg, %i[pointer int], :int def self.read_load_averages raw_loadavg = ::FFI::MemoryPointer.new(:double, 3) res = LoadAverages.getloadavg(raw_loadavg, 3) return unless res == 3 raw_loadavg.read_array_of_double(res) end end end end end end
Version data entries
39 entries across 39 versions & 1 rubygems