• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[package]
2name = "rustix"
3version = "0.36.16"
4authors = [
5    "Dan Gohman <dev@sunfishcode.online>",
6    "Jakub Konka <kubkon@jakubkonka.com>",
7]
8description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-like syscalls"
9documentation = "https://docs.rs/rustix"
10license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
11repository = "https://github.com/bytecodealliance/rustix"
12edition = "2018"
13keywords = ["api", "file", "network", "safe", "syscall"]
14categories = ["os::unix-apis", "date-and-time", "filesystem", "network-programming"]
15include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md", "benches"]
16rust-version = "1.48"
17
18[build-dependencies]
19cc = { version = "1.0.68", optional = true }
20
21[dependencies]
22bitflags = "1.2.1"
23itoa = { version = "1.0.1", default-features = false, optional = true }
24io-lifetimes = { version = "1.0.0", default-features = false, features = ["close"], optional = true }
25
26# Special dependencies used in rustc-dep-of-std mode.
27core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
28alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
29compiler_builtins = { version = '0.1.49', optional = true }
30
31# The procfs feature needs once_cell.
32[target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies]
33once_cell = { version = "1.5.2", optional = true }
34
35# Dependencies for platforms where linux_raw is supported, in addition to libc:
36#
37# On Linux on selected architectures, the linux_raw backend is supported, in
38# addition to the libc backend. The linux_raw backend is used by default. The
39# libc backend can be selected via adding `--cfg=rustix_use_libc` to
40# `RUSTFLAGS` or enabling the `use-libc` cargo feature.
41[target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))'.dependencies]
42linux-raw-sys = { version = "0.1.2", default-features = false, features = ["general", "errno", "ioctl", "no_std"] }
43libc_errno = { package = "errno", version = "0.3.0", default-features = false, optional = true }
44libc = { version = "0.2.133", features = ["extra_traits"], optional = true }
45
46# Dependencies for platforms where only libc is supported:
47#
48# On all other Unix-family platforms, and under Miri, we always use the libc
49# backend, so enable its dependencies unconditionally.
50[target.'cfg(any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))))'.dependencies]
51libc_errno = { package = "errno", version = "0.3.0", default-features = false }
52libc = { version = "0.2.133", features = ["extra_traits"] }
53
54# Additional dependencies for Linux with the libc backend:
55#
56# Some syscalls do not have libc wrappers, such as in `io_uring`. For these,
57# the libc backend uses the linux-raw-sys ABI and `libc::syscall`.
58[target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64"))))))))'.dependencies]
59linux-raw-sys = { version = "0.1.2", default-features = false, features = ["general", "no_std"] }
60
61# For the libc backend on Windows, use the Winsock2 API in windows-sys.
62[target.'cfg(windows)'.dependencies.windows-sys]
63version = "0.45.0"
64features = [
65    "Win32_Foundation",
66    "Win32_Networking_WinSock",
67    "Win32_NetworkManagement_IpHelper",
68    "Win32_System_Threading"
69]
70
71[dev-dependencies]
72tempfile = "3.2.0"
73libc = "0.2.133"
74libc_errno = { package = "errno", version = "0.3.0", default-features = false }
75io-lifetimes = { version = "1.0.0", default-features = false, features = ["close"] }
76memoffset = "0.7.1"
77flate2 = "1.0"
78
79[target.'cfg(windows)'.dev-dependencies]
80ctor = "0.1.21"
81
82[package.metadata.docs.rs]
83features = ["all-apis"]
84rustdoc-args = ["--cfg", "doc_cfg"]
85targets = [
86    "x86_64-unknown-linux-gnu",
87    "i686-unknown-linux-gnu",
88    "x86_64-apple-darwin",
89    "x86_64-pc-windows-msvc",
90]
91
92[features]
93
94# By default, use `std` and use libc for aux values.
95#
96# It turns out to be bizarrely awkward to obtain the aux values reliably and
97# efficiently on Linux from anywhere other than libc. We can do it, but most
98# users are better served by just using libc for this.
99default = ["std", "use-libc-auxv"]
100
101# This enables use of std. Disabling this enables `#![no_std], and requires
102# Rust 1.64 or newer.
103std = ["io-lifetimes"]
104
105# This is used in the port of std to rustix.
106rustc-dep-of-std = [
107    "core",
108    "alloc",
109    "compiler_builtins",
110    "linux-raw-sys/rustc-dep-of-std",
111    "bitflags/rustc-dep-of-std",
112]
113
114# Enable this to request the libc backend.
115use-libc = ["libc_errno", "libc"]
116
117# Enable `rustix::fs::*`.
118fs = []
119
120# Enable `rustix::io_uring::*` (on platforms that support it).
121io_uring = ["fs", "net"]
122
123# Enable `rustix::net::*`.
124net = []
125
126# Enable `rustix::thread::*`.
127thread = []
128
129# Enable `rustix::process::*`.
130process = []
131
132# Enable `rustix::time::*`.
133time = []
134
135# Enable `rustix::param::*`.
136param = ["fs"]
137
138# Enable this to enable `rustix::io::proc_self_*` (on Linux) and `ttyname`.
139procfs = ["once_cell", "itoa", "fs"]
140
141# Enable `rustix::termios::*`.
142termios = []
143
144# Enable `rustix::mm::*`.
145mm = []
146
147# Enable `rustix::rand::*`.
148rand = []
149
150# Enable `rustix::runtime::*`. This API is undocumented and unstable.
151runtime = []
152
153# Enable all API features.
154all-apis = [
155    "fs",
156    "io_uring",
157    "mm",
158    "net",
159    "param",
160    "process",
161    "procfs",
162    "rand",
163    "runtime",
164    "termios",
165    "thread",
166    "time",
167]
168
169# When using the linux_raw backend, and not using Mustang, should we use libc
170# for reading the aux vectors, instead of reading them ourselves from
171# /proc/self/auxv?
172use-libc-auxv = ["libc"]
173
174# Expose io-lifetimes' features for third-party crate impls.
175# Some of these are temporarily disabled, until the upstream creates add the
176# needed trait implementations.
177#async-std = ["io-lifetimes/async-std"]
178#tokio = ["io-lifetimes/tokio"]
179os_pipe = ["io-lifetimes/os_pipe"]
180#socket2 = ["io-lifetimes/socket2"]
181#mio = ["io-lifetimes/mio"]
182fs-err = ["io-lifetimes/fs-err"]
183#all-impls = ["async-std", "tokio", "os_pipe", "socket2", "mio", "fs-err"]
184all-impls = ["os_pipe", "fs-err"]
185