commit | decd21148e503fd5f012ff46d68c4cc849088835 | [log] [tgz] |
---|---|---|
author | William Escande <wescande@google.com> | Tue Aug 23 01:41:05 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 23 01:41:05 2022 +0000 |
tree | be61ef64cd7cc31a2b4460c0a5d440b7e9662c05 | |
parent | 0f46ea13eb3785a792505b916d1ad2d053e3ae67 [diff] | |
parent | 0cd6f485e2466e0675751b3153848c61d95c12cb [diff] |
[Bluetooth apex] Use new apex name am: c73204e98e am: 459dbbde3b am: 11cdbb79d8 am: 7fabe1657a am: 0cd6f485e2 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/nix/+/2192046 Change-Id: I48ca103bf91b4a2798b3807c40764d7e067cc555 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Nix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin, ...). The goal is to not provide a 100% unified interface, but to unify what can be while still providing platform specific APIs.
For many system APIs, Nix provides a safe alternative to the unsafe APIs exposed by the libc crate. This is done by wrapping the libc functionality with types/abstractions that enforce legal/safe usage.
As an example of what Nix provides, examine the differences between what is exposed by libc and nix for the gethostname system call:
// libc api (unsafe, requires handling return code/errno) pub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -> c_int; // nix api (returns a nix::Result<CStr>) pub fn gethostname<'a>(buffer: &'a mut [u8]) -> Result<&'a CStr>;
nix target support consists of two tiers. While nix attempts to support all platforms supported by libc, only some platforms are actively supported due to either technical or manpower limitations. Support for platforms is split into three tiers:
The following targets are supported by nix
:
Tier 1:
Tier 2:
Tier 3:
nix is supported on Rust 1.46.0 and higher. It's MSRV will not be changed in the future without bumping the major or minor version.
Contributions are very welcome. Please See CONTRIBUTING for additional details.
Feel free to join us in the nix-rust/nix channel on Gitter to discuss nix
development.
Nix is licensed under the MIT license. See LICENSE for more details.