279 lines
10 KiB
TOML
279 lines
10 KiB
TOML
[package]
|
|
name = "rustix"
|
|
version = "1.1.4"
|
|
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 = "2021"
|
|
keywords = ["api", "file", "network", "safe", "syscall"]
|
|
categories = ["os::unix-apis", "date-and-time", "filesystem", "network-programming"]
|
|
include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md", "benches"]
|
|
rust-version = "1.63"
|
|
|
|
[hints]
|
|
# Most users use a fraction of the rustix API surface area, so this reduces compilation times
|
|
mostly-unused = true
|
|
|
|
[dependencies]
|
|
bitflags = { version = "2.4.0", default-features = false }
|
|
|
|
# Special dependencies used in rustc-dep-of-std mode.
|
|
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
|
|
rustc-std-workspace-alloc = { version = "1.0.0", optional = true } # not aliased here but in lib.rs because of name collision with the alloc feature
|
|
|
|
# Dependencies for platforms where linux_raw is supported, in addition to libc:
|
|
#
|
|
# On Linux on selected architectures, the linux_raw backend is supported, in
|
|
# addition to the libc backend. The linux_raw backend is used by default. The
|
|
# libc backend can be selected via adding `--cfg=rustix_use_libc` to
|
|
# `RUSTFLAGS` or enabling the `use-libc` cargo feature.
|
|
[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"))))'.dependencies]
|
|
linux-raw-sys = { version = "0.12", default-features = false, features = ["auxvec", "general", "errno", "ioctl", "no_std", "elf"] }
|
|
libc_errno = { package = "errno", version = "0.3.10", default-features = false, optional = true }
|
|
libc = { version = "0.2.182", default-features = false, optional = true }
|
|
|
|
# Dependencies for platforms where only libc is supported:
|
|
#
|
|
# On all other Unix-family platforms, and under Miri, we always use the libc
|
|
# backend, so enable its dependencies unconditionally.
|
|
[target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
|
|
libc_errno = { package = "errno", version = "0.3.10", default-features = false }
|
|
libc = { version = "0.2.182", default-features = false }
|
|
|
|
# Additional dependencies for Linux and Android with the libc backend:
|
|
#
|
|
# Some syscalls do not have libc wrappers, such as in `io_uring`. For these,
|
|
# the libc backend uses the linux-raw-sys ABI and `libc::syscall`.
|
|
[target.'cfg(all(any(target_os = "linux", target_os = "android"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_endian = "little", any(target_arch = "s390x", target_arch = "powerpc")), any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc"), all(rustix_use_experimental_asm, target_arch = "powerpc64"), all(rustix_use_experimental_asm, target_arch = "s390x"), all(rustix_use_experimental_asm, target_arch = "mips"), all(rustix_use_experimental_asm, target_arch = "mips32r6"), all(rustix_use_experimental_asm, target_arch = "mips64"), all(rustix_use_experimental_asm, target_arch = "mips64r6"), target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64")))))))'.dependencies]
|
|
linux-raw-sys = { version = "0.12", default-features = false, features = ["general", "ioctl", "no_std"] }
|
|
|
|
# For the libc backend on Windows, use the Winsock API in windows-sys.
|
|
[target.'cfg(windows)'.dependencies.windows-sys]
|
|
version = ">=0.52, <0.62"
|
|
features = [
|
|
"Win32_Foundation",
|
|
"Win32_Networking_WinSock",
|
|
]
|
|
|
|
# For the libc backend on Windows, also use the errno crate, which has Windows
|
|
# support.
|
|
[target.'cfg(windows)'.dependencies.libc_errno]
|
|
version = "0.3.10"
|
|
package = "errno"
|
|
default-features = false
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3.5.0"
|
|
libc = "0.2.171"
|
|
libc_errno = { package = "errno", version = "0.3.10", default-features = false }
|
|
serial_test = "2.0.0"
|
|
memoffset = "0.9.0"
|
|
flate2 = "1.0"
|
|
static_assertions = "1.1.0"
|
|
|
|
# With Rust 1.70 this can be removed in favor of `std::sync::OnceLock`.
|
|
[target.'cfg(windows)'.dev-dependencies]
|
|
once_cell = "1.20.3"
|
|
|
|
[target.'cfg(all(criterion, not(any(target_os = "emscripten", target_os = "wasi"))))'.dev-dependencies]
|
|
criterion = "0.4"
|
|
|
|
# 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 = ["all-apis"]
|
|
targets = [
|
|
"x86_64-unknown-linux-gnu",
|
|
"i686-unknown-linux-gnu",
|
|
"x86_64-apple-darwin",
|
|
"x86_64-pc-windows-msvc",
|
|
"x86_64-unknown-freebsd",
|
|
"x86_64-unknown-openbsd",
|
|
"x86_64-unknown-netbsd",
|
|
"x86_64-unknown-dragonfly",
|
|
"x86_64-unknown-illumos",
|
|
"x86_64-unknown-redox",
|
|
"x86_64-unknown-haiku",
|
|
"wasm32-unknown-emscripten",
|
|
"wasm32-wasip1",
|
|
]
|
|
|
|
[features]
|
|
|
|
# By default, use `std`.
|
|
default = ["std"]
|
|
|
|
# This enables use of std. Disabling this enables `#![no_std]`, and requires
|
|
# Rust 1.77 or newer.
|
|
std = ["bitflags/std", "alloc", "libc?/std", "libc_errno?/std"]
|
|
|
|
# Enable this to request the libc backend.
|
|
use-libc = ["libc_errno", "libc"]
|
|
|
|
# Enable `rustix::event::*`.
|
|
event = []
|
|
|
|
# Enable `rustix::fs::*`.
|
|
fs = []
|
|
|
|
# Enable `rustix::io_uring::*` (on platforms that support it).
|
|
io_uring = ["event", "fs", "net", "thread", "linux-raw-sys/io_uring"]
|
|
|
|
# Enable `rustix::mount::*`.
|
|
mount = []
|
|
|
|
# Enable `rustix::net::*`.
|
|
net = ["linux-raw-sys/net", "linux-raw-sys/netlink", "linux-raw-sys/if_ether", "linux-raw-sys/xdp"]
|
|
|
|
# Enable `rustix::thread::*`.
|
|
thread = ["linux-raw-sys/prctl"]
|
|
|
|
# Enable `rustix::process::*`.
|
|
process = ["linux-raw-sys/prctl"]
|
|
|
|
# Enable `rustix::shm::*`.
|
|
shm = ["fs"]
|
|
|
|
# Enable `rustix::time::*`.
|
|
time = []
|
|
|
|
# Enable `rustix::param::*`.
|
|
param = []
|
|
|
|
# Enable `rustix::pty::*`.
|
|
pty = ["fs"]
|
|
|
|
# Enable `rustix::termios::*`.
|
|
termios = []
|
|
|
|
# Enable `rustix::mm::*`.
|
|
mm = []
|
|
|
|
# Enable `rustix::pipe::*`.
|
|
pipe = []
|
|
|
|
# Enable `rustix::rand::*`.
|
|
rand = []
|
|
|
|
# Enable `rustix::stdio::*`.
|
|
stdio = []
|
|
|
|
# Enable `rustix::system::*`.
|
|
system = ["linux-raw-sys/system"]
|
|
|
|
# Enable `rustix::runtime::*`. ⚠ This API is undocumented and unstable and
|
|
# experimental and not intended for general-purpose use. ⚠
|
|
runtime = ["linux-raw-sys/prctl"]
|
|
|
|
# Enable all API features.
|
|
#
|
|
# This is primarily intended for rustix developers. Users are encouraged to
|
|
# enable only those features they need.
|
|
all-apis = [
|
|
"event",
|
|
"fs",
|
|
"io_uring",
|
|
"mm",
|
|
"mount",
|
|
"net",
|
|
"param",
|
|
"pipe",
|
|
"process",
|
|
"pty",
|
|
"rand",
|
|
"runtime",
|
|
"shm",
|
|
"stdio",
|
|
"system",
|
|
"termios",
|
|
"thread",
|
|
"time",
|
|
]
|
|
|
|
# When using the linux_raw backend, should we use `getauxval` for reading aux
|
|
# vectors, instead of `PR_GET_AUXV` or "/proc/self/auxv"?
|
|
use-libc-auxv = []
|
|
|
|
# Enable "use-explicitly-provided-auxv" mode, with a public
|
|
# `rustix::param::init` function that must be called before anything else in
|
|
# rustix. This is unstable and experimental and not intended for
|
|
# general-purpose use.
|
|
use-explicitly-provided-auxv = []
|
|
|
|
# OS compatibility features
|
|
|
|
# Specialize for Linux 4.11 or later
|
|
linux_4_11 = []
|
|
|
|
# Specialize for Linux 5.1 or later
|
|
linux_5_1 = ["linux_4_11"]
|
|
|
|
# Specialize for Linux 5.11 or later
|
|
linux_5_11 = ["linux_5_1"]
|
|
|
|
# Enable all specializations for the latest Linux versions.
|
|
linux_latest = ["linux_5_11"]
|
|
|
|
# Enable features which depend on the Rust global allocator, such as functions
|
|
# that return owned strings or `Vec`s.
|
|
alloc = []
|
|
|
|
# This is used in the port of std to rustix. This is experimental and not meant
|
|
# for regular use.
|
|
rustc-dep-of-std = [
|
|
"core",
|
|
"rustc-std-workspace-alloc",
|
|
"linux-raw-sys/rustc-dep-of-std",
|
|
"bitflags/rustc-dep-of-std",
|
|
]
|
|
|
|
# Enable `rustix::io::try_close`. The rustix developers do not intend the
|
|
# existence of this feature to imply that anyone should use it.
|
|
try_close = []
|
|
|
|
[lints.rust.unexpected_cfgs]
|
|
level = "warn"
|
|
check-cfg = [
|
|
'cfg(alloc_c_string)',
|
|
'cfg(alloc_ffi)',
|
|
'cfg(apple)',
|
|
'cfg(asm_experimental_arch)',
|
|
'cfg(bsd)',
|
|
'cfg(core_c_str)',
|
|
'cfg(core_ffi_c)',
|
|
'cfg(core_intrinsics)',
|
|
'cfg(criterion)',
|
|
'cfg(document_experimental_runtime_api)',
|
|
'cfg(error_in_core)',
|
|
'cfg(fix_y2038)',
|
|
'cfg(freebsdlike)',
|
|
'cfg(libc)',
|
|
'cfg(linux_kernel)',
|
|
'cfg(linux_like)',
|
|
'cfg(linux_raw)',
|
|
'cfg(linux_raw_dep)',
|
|
'cfg(lower_upper_exp_for_non_zero)',
|
|
'cfg(sanitize_memory)',
|
|
'cfg(netbsdlike)',
|
|
'cfg(rustc_attrs)',
|
|
'cfg(rustc_diagnostics)',
|
|
'cfg(solarish)',
|
|
'cfg(staged_api)',
|
|
'cfg(static_assertions)',
|
|
'cfg(thumb_mode)',
|
|
'cfg(wasi)',
|
|
'cfg(wasi_ext)',
|
|
'cfg(wasip2)',
|
|
'cfg(target_arch, values("xtensa"))',
|
|
'cfg(target_os, values("cygwin"))',
|
|
]
|