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.



133
134
135
136
137
138
139
# File 'lib/linux_stat/os.rb', line 133

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