diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 80a825096..4c7a84f16 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -28,6 +28,22 @@ module Vagrant false end + # Returns boolean noting whether this is a 64-bit CPU. This + # is not 100% accurate and there could easily be false negatives. + # + # @return [Boolean] + def bit64? + ["x86_64", "amd64"].include?(::Config::CONFIG["host_cpu"]) + end + + # Returns boolean noting whether this is a 32-bit CPU. This + # can easily throw false positives since it relies on {#bit64?}. + # + # @return [Boolean] + def bit32? + !bit64? + end + def tar_file_options # create, write only, fail if the file exists, binary if windows File::WRONLY|File::EXCL|File::CREAT|(Mario::Platform.windows? ? File::BINARY : 0)