#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

#542 in Operating systems

Download history 710/week @ 2024-08-31 754/week @ 2024-09-07 808/week @ 2024-09-14 659/week @ 2024-09-21 1202/week @ 2024-09-28 1663/week @ 2024-10-05 1776/week @ 2024-10-12 1895/week @ 2024-10-19 2072/week @ 2024-10-26 2001/week @ 2024-11-02 2082/week @ 2024-11-09 1807/week @ 2024-11-16 1725/week @ 2024-11-23 1819/week @ 2024-11-30 2301/week @ 2024-12-07 1614/week @ 2024-12-14

7,673 downloads per month
Used in 7 crates (4 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
~51K SLoC