How to check if the OS is 64 Bit?


is there a simple way to check if the OS is 64 Bit or not. I dont`t want to know if the programm runs as 64 Bit. So I like to know regardless of the builded executeable (32 Bit / 64 Bit) if the OS itself could handle 64 Bit.

For .Net there seems to be a System Property called Environment.Is64BitOperating.

Is there something similar in Rust?


Wow that was fast. Thanks

1 Like

Note, that relies on the uname machine, which can be faked with setarch.

1 Like

Yes, by changing your bitness you can fool the bitness module into reading your machine's bitness.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.