[go: up one dir, main page]

rustix 0.29.1

Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls
Documentation
[package]
name = "rustix"
version = "0.29.1"
authors = [
    "Dan Gohman <dev@sunfishcode.online>",
    "Jakub Konka <kubkon@jakubkonka.com>",
]
description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls"
documentation = "https://docs.rs/rustix"
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
repository = "https://github.com/bytecodealliance/rustix"
edition = "2018"
keywords = ["api", "file", "network", "safe", "syscall"]
categories = ["os::unix-apis", "date-and-time", "filesystem", "network-programming"]
exclude = ["/.github"]

[build-dependencies]
cc = { version = "1.0.68", optional = true }

[dependencies]
bitflags = "1.2.1"
itoa = { version = "0.4.7", default-features = false, optional = true }
io-lifetimes = { version = "0.4.0", default-features = false, optional = true }

# Special dependencies used in rustc-dep-of-std mode.
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
compiler_builtins = { version = '0.1.49', optional = true }

# The procfs feature needs once_cell.
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
once_cell = { version = "1.5.2", optional = true }

# For the linux_raw backend, linux-raw-sys provides Linux ABI details.
[target.'cfg(all(not(rustix_use_libc), any(target_os = "linux"), any(target_arch = "x86", all(target_arch = "x86_64", not(target_pointer_width = "32")), target_arch = "arm", target_arch = "aarch64", target_arch = "riscv64")))'.dependencies]
linux-raw-sys = { version = "0.0.36", default-features = false, features = ["general", "errno", "v5_4", "v5_11"] }

# For the libc backend on Unix platforms, use the libc crate, and errno for
# setting `errno`.
[target.'cfg(any(rustix_use_libc, not(all(any(target_os = "linux"), any(target_arch = "x86", all(target_arch = "x86_64", not(target_pointer_width = "32")), target_arch = "arm", target_arch = "aarch64", target_arch = "riscv64")))))'.dependencies]
errno = { version = "0.2.8", default-features = false }
libc = { version = "0.2.98", features = ["extra_traits"] }

# For the libc backend on Windows, use the Winsock API in winapi.
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["ws2ipdef", "ws2tcpip"] }

[dev-dependencies]
atty = "0.2.14"
tempfile = "3.2.0"
libc = "0.2.98"
serial_test = "0.5"

[target.'cfg(not(target_os = "emscripten"))'.dev-dependencies]
criterion = "0.3"

[features]
default = ["std"]
std = ["io-lifetimes", "linux-raw-sys/std"]
rustc-dep-of-std = [
    "core",
    "alloc",
    "compiler_builtins",
    "linux-raw-sys/rustc-dep-of-std",
    "bitflags/rustc-dep-of-std",
]

# Enable this to enable `proc_self_fd` (on Linux) and `ttyname`.
procfs = ["once_cell", "itoa"]

# Expose io-lifetimes' features for third-party crate impls.
async-std = ["io-lifetimes/async-std"]
tokio = ["io-lifetimes/tokio"]
os_pipe = ["io-lifetimes/os_pipe"]
socket2 = ["io-lifetimes/socket2"]
mio = ["io-lifetimes/mio"]
fs-err = ["io-lifetimes/fs-err"]
all-impls = ["async-std", "tokio", "os_pipe", "socket2", "mio", "fs-err"]

# Add Criterion configuration, as described here:
# <https://bheisler.github.io/criterion.rs/book/getting_started.html#step-1---add-dependency-to-cargotoml>
[[bench]]
name = "mod"
harness = false

[package.metadata.docs.rs]
features = ["procfs"]
rustdoc-args = ["--cfg", "doc_cfg"]
targets = [
    "x86_64-unknown-linux-gnu",
    "i686-unknown-linux-gnu",
    "x86_64-apple-darwin",
    "x86_64-pc-windows-msvc",
]