illumos-nvpair-sys 0.2.0

Raw FFI bindings to illumos libnvpair
Documentation
  • Coverage
  • 0%
    0 out of 185 items documented0 out of 5 items with examples
  • Size
  • Source code size: 29.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 6.83 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 50s Average build duration of successful builds.
  • all releases: 51s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • oxidecomputer/illumos-nvpair
    2 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • smklein

illumos-nvpair-sys

Raw Rust FFI bindings to illumos libnvpair, generated from the system header sys/nvpair.h (documented by wrapper.h in this directory).

How bindings are generated

The bindings in src/lib.rs are pre-generated by bindgen and checked into source control. Bindgen is not run at build time - build.rs only contains a linker directive (cargo:rustc-link-lib=nvpair).

To regenerate, run generate.sh on an illumos machine with bindgen installed (cargo install bindgen-cli):

./generate.sh

The script runs bindgen with the following flags:

  • --allowlist-function 'nvlist_.*' and --allowlist-function 'nvpair_.*'
    • emit only nvlist/nvpair symbols, not the entire transitive header tree
  • --allowlist-var 'NV_.*' and --allowlist-var 'data_type_t_.*' - capture constants like NV_UNIQUE_NAME and data_type_t_DATA_TYPE_STRING
  • --raw-line '#![allow(...)]' - prepend an attribute to suppress warnings on the snake_case and UPPER_CASE names that bindgen produces for C typedefs and enum-style constants

The nvpair ABI is version 0 and effectively frozen - it is used throughout illumos (ZFS, FMA, sysevent, etc.) and has not had a breaking change.