Method: LinuxStat::OS.bits

Defined in:
lib/linux_stat/os.rb

.bitsObject

Reads ruby configuration and tries to guess if the system is 64 bit.

If it fails then it runs utsname.h to guess the machine.

It the machine is 64 bits, it will return 64, else it returns 32.

The return type is strictly Integer and doesn’t fail.



129
130
131
132
133
134
135
# File 'lib/linux_stat/os.rb', line 129

def bits
	@@bits ||= if RbConfig::CONFIG['host_cpu'].end_with?('64') || RUBY_PLATFORM.end_with?('64') || machine.end_with?('64')
		64
	else
		32
	end
end