#freebsd #executable #detecting #64-bit #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

#323 in Operating systems

Download history 719/week @ 2023-12-09 614/week @ 2023-12-16 401/week @ 2023-12-23 589/week @ 2023-12-30 345/week @ 2024-01-06 488/week @ 2024-01-13 339/week @ 2024-01-20 328/week @ 2024-01-27 811/week @ 2024-02-03 412/week @ 2024-02-10 471/week @ 2024-02-17 605/week @ 2024-02-24 550/week @ 2024-03-02 516/week @ 2024-03-09 394/week @ 2024-03-16 412/week @ 2024-03-23

1,966 downloads per month
Used in 4 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.4–1MB
~22K SLoC