#freebsd #executable #64-bit #detecting #32-bit #gnu-linux

bin+lib bitness

Rust library for detecting OS bitness independently of the executable's bitness. Windows, GNU/Linux and FreeBSD currently supported.

7 unstable releases

0.4.0 Nov 20, 2020
0.3.3 Jan 17, 2018
0.2.0 Jan 13, 2018
0.1.0 Jan 11, 2018

#498 in Operating systems

Download history 1873/week @ 2024-11-15 1680/week @ 2024-11-22 1841/week @ 2024-11-29 2180/week @ 2024-12-06 1960/week @ 2024-12-13 1731/week @ 2024-12-20 2027/week @ 2024-12-27 2153/week @ 2025-01-03 2229/week @ 2025-01-10 2329/week @ 2025-01-17 2066/week @ 2025-01-24 1906/week @ 2025-01-31 2029/week @ 2025-02-07 2172/week @ 2025-02-14 2466/week @ 2025-02-21 1810/week @ 2025-02-28

8,742 downloads per month
Used in 5 crates (3 directly)

MIT/Apache

10KB
87 lines

Bitness Build Status Build status Crates.io

Rust library for detecting OS bitness independently of the executable's bitness. Windows, GNU/Linux and FreeBSD currently supported.

How to use

let bitness = bitness::os_bitness().unwrap();

match bitness {
  Bitness::X86_32 => println!("We're 32-bit!"),
  Bitness::X86_64 => println!("We're 64-bit!"),
  _ => { }
}

Dependencies

~0.2–7MB
~48K SLoC