1 | [package] |
2 | name = "rustix" |
3 | version = "0.38.32" |
4 | authors = [ |
5 | "Dan Gohman <dev@sunfishcode.online>" , |
6 | "Jakub Konka <kubkon@jakubkonka.com>" , |
7 | ] |
8 | description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock-like syscalls" |
9 | documentation = "https://docs.rs/rustix" |
10 | license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" |
11 | repository = "https://github.com/bytecodealliance/rustix" |
12 | edition = "2021" |
13 | keywords = ["api" , "file" , "network" , "safe" , "syscall" ] |
14 | categories = ["os::unix-apis" , "date-and-time" , "filesystem" , "network-programming" ] |
15 | include = ["src" , "build.rs" , "Cargo.toml" , "COPYRIGHT" , "LICENSE*" , "/*.md" , "benches" ] |
16 | rust-version = "1.63" |
17 | |
18 | [dependencies] |
19 | bitflags = { version = "2.4.0" , default-features = false } |
20 | itoa = { version = "1.0.1" , default-features = false, optional = true } |
21 | |
22 | # Special dependencies used in rustc-dep-of-std mode. |
23 | core = { version = "1.0.0" , optional = true, package = "rustc-std-workspace-core" } |
24 | alloc = { version = "1.0.0" , optional = true, package = "rustc-std-workspace-alloc" } |
25 | compiler_builtins = { version = '0.1.49' , optional = true } |
26 | |
27 | # The procfs feature needs once_cell. |
28 | # With Rust 1.70.0, we can switch to `core::cell::OnceCell`. |
29 | [target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies] |
30 | once_cell = { version = "1.5.2" , optional = true } |
31 | |
32 | # Dependencies for platforms where linux_raw is supported, in addition to libc: |
33 | # |
34 | # On Linux on selected architectures, the linux_raw backend is supported, in |
35 | # addition to the libc backend. The linux_raw backend is used by default. The |
36 | # libc backend can be selected via adding `--cfg=rustix_use_libc` to |
37 | # `RUSTFLAGS` or enabling the `use-libc` cargo feature. |
38 | [target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), 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] |
39 | linux-raw-sys = { version = "0.4.12" , default-features = false, features = ["general" , "errno" , "ioctl" , "no_std" , "elf" ] } |
40 | libc_errno = { package = "errno" , version = "0.3.8" , default-features = false, optional = true } |
41 | libc = { version = "0.2.153" , default-features = false, features = ["extra_traits" ], optional = true } |
42 | |
43 | # Dependencies for platforms where only libc is supported: |
44 | # |
45 | # On all other Unix-family platforms, and under Miri, we always use the libc |
46 | # backend, so enable its dependencies unconditionally. |
47 | [target.'cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), 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] |
48 | libc_errno = { package = "errno" , version = "0.3.8" , default-features = false } |
49 | libc = { version = "0.2.153" , default-features = false, features = ["extra_traits" ] } |
50 | |
51 | # Additional dependencies for Linux with the libc backend: |
52 | # |
53 | # Some syscalls do not have libc wrappers, such as in `io_uring`. For these, |
54 | # the libc backend uses the linux-raw-sys ABI and `libc::syscall`. |
55 | [target.'cfg(all(any(target_os = "android", target_os = "linux"), any(rustix_use_libc, miri, not(all(target_os = "linux", target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "riscv64", all(rustix_use_experimental_asm, target_arch = "powerpc64"), 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] |
56 | linux-raw-sys = { version = "0.4.12" , default-features = false, features = ["general" , "ioctl" , "no_std" ] } |
57 | |
58 | # For the libc backend on Windows, use the Winsock API in windows-sys. |
59 | [target.'cfg(windows)'.dependencies.windows-sys] |
60 | version = "0.52.0" |
61 | features = [ |
62 | "Win32_Foundation" , |
63 | "Win32_Networking_WinSock" , |
64 | "Win32_NetworkManagement_IpHelper" , |
65 | "Win32_System_Threading" |
66 | ] |
67 | |
68 | # For the libc backend on Windows, also use the errno crate, which has Windows |
69 | # support. |
70 | [target.'cfg(windows)'.dependencies.libc_errno] |
71 | version = "0.3.8" |
72 | package = "errno" |
73 | default-features = false |
74 | |
75 | [dev-dependencies] |
76 | tempfile = "3.5.0" |
77 | libc = "0.2.153" |
78 | libc_errno = { package = "errno" , version = "0.3.8" , default-features = false } |
79 | serial_test = "2.0.0" |
80 | memoffset = "0.9.0" |
81 | flate2 = "1.0" |
82 | static_assertions = "1.1.0" |
83 | |
84 | [target.'cfg(all(criterion, not(any(target_os = "emscripten", target_os = "wasi"))))'.dev-dependencies] |
85 | criterion = "0.4" |
86 | |
87 | [target.'cfg(windows)'.dev-dependencies] |
88 | ctor = "0.2.0" |
89 | |
90 | # Add Criterion configuration, as described here: |
91 | # <https://bheisler.github.io/criterion.rs/book/getting_started.html#step-1---add-dependency-to-cargotoml> |
92 | [[bench]] |
93 | name = "mod" |
94 | harness = false |
95 | |
96 | [package.metadata.docs.rs] |
97 | features = ["all-apis" ] |
98 | rustdoc-args = ["--cfg" , "doc_cfg" ] |
99 | targets = [ |
100 | "x86_64-unknown-linux-gnu" , |
101 | "i686-unknown-linux-gnu" , |
102 | "x86_64-apple-darwin" , |
103 | "x86_64-pc-windows-msvc" , |
104 | "x86_64-unknown-freebsd" , |
105 | "x86_64-unknown-openbsd" , |
106 | "x86_64-unknown-netbsd" , |
107 | "x86_64-unknown-dragonfly" , |
108 | "x86_64-unknown-illumos" , |
109 | "x86_64-unknown-redox" , |
110 | "x86_64-unknown-haiku" , |
111 | "wasm32-unknown-emscripten" , |
112 | "wasm32-wasi" , |
113 | ] |
114 | |
115 | [features] |
116 | |
117 | # By default, use `std` and use libc for aux values. |
118 | # |
119 | # It turns out to be bizarrely awkward to obtain the aux values reliably and |
120 | # efficiently on Linux from anywhere other than libc. We can do it, but most |
121 | # users are better served by just using libc for this. |
122 | default = ["std" , "use-libc-auxv" ] |
123 | |
124 | # This enables use of std. Disabling this enables `#![no_std]`, and requires |
125 | # Rust 1.64 or newer. |
126 | std = ["bitflags/std" , "alloc" , "libc?/std" , "libc_errno?/std" ] |
127 | |
128 | # Enable this to request the libc backend. |
129 | use-libc = ["libc_errno" , "libc" ] |
130 | |
131 | # Enable `rustix::event::*`. |
132 | event = [] |
133 | |
134 | # Enable `rustix::fs::*`. |
135 | fs = [] |
136 | |
137 | # Enable `rustix::io_uring::*` (on platforms that support it). |
138 | io_uring = ["event" , "fs" , "net" , "linux-raw-sys/io_uring" ] |
139 | |
140 | # Enable `rustix::mount::*`. |
141 | mount = [] |
142 | |
143 | # Enable `rustix::net::*`. |
144 | net = ["linux-raw-sys/net" , "linux-raw-sys/netlink" , "linux-raw-sys/if_ether" , "linux-raw-sys/xdp" ] |
145 | |
146 | # Enable `rustix::thread::*`. |
147 | thread = ["linux-raw-sys/prctl" ] |
148 | |
149 | # Enable `rustix::process::*`. |
150 | process = ["linux-raw-sys/prctl" ] |
151 | |
152 | # Enable `rustix::shm::*`. |
153 | shm = ["fs" ] |
154 | |
155 | # Enable `rustix::time::*`. |
156 | time = [] |
157 | |
158 | # Enable `rustix::param::*`. |
159 | param = ["fs" ] |
160 | |
161 | # Enable this to enable `rustix::io::proc_self_*` (on Linux) and `ttyname`. |
162 | procfs = ["once_cell" , "itoa" , "fs" ] |
163 | |
164 | # Enable `rustix::pty::*`. |
165 | pty = ["itoa" , "fs" ] |
166 | |
167 | # Enable `rustix::termios::*`. |
168 | termios = [] |
169 | |
170 | # Enable `rustix::mm::*`. |
171 | mm = [] |
172 | |
173 | # Enable `rustix::pipe::*`. |
174 | pipe = [] |
175 | |
176 | # Enable `rustix::rand::*`. |
177 | rand = [] |
178 | |
179 | # Enable `rustix::stdio::*`. |
180 | stdio = [] |
181 | |
182 | # Enable `rustix::system::*`. |
183 | system = ["linux-raw-sys/system" ] |
184 | |
185 | # Enable `rustix::runtime::*`. This API is undocumented and unstable and |
186 | # experimental and not intended for general-purpose use. |
187 | runtime = ["linux-raw-sys/prctl" ] |
188 | |
189 | # Enable all API features. |
190 | all-apis = [ |
191 | "event" , |
192 | "fs" , |
193 | "io_uring" , |
194 | "mm" , |
195 | "mount" , |
196 | "net" , |
197 | "param" , |
198 | "pipe" , |
199 | "process" , |
200 | "procfs" , |
201 | "pty" , |
202 | "rand" , |
203 | "runtime" , |
204 | "shm" , |
205 | "stdio" , |
206 | "system" , |
207 | "termios" , |
208 | "thread" , |
209 | "time" , |
210 | ] |
211 | |
212 | # When using the linux_raw backend, should we use libc for reading the aux |
213 | # vectors, instead of reading them ourselves from /proc/self/auxv? |
214 | use-libc-auxv = [] |
215 | |
216 | # Enable "use-explicitly-provided-auxv" mode, with a public |
217 | # `rustix::param::init` function that must be called before anything else in |
218 | # rustix. This is unstable and experimental and not intended for |
219 | # general-purpose use. |
220 | use-explicitly-provided-auxv = [] |
221 | |
222 | # OS compatibility features |
223 | |
224 | # Optimize for Linux 4.11 or later |
225 | linux_4_11 = [] |
226 | |
227 | # Enable all optimizations for the latest Linux versions. |
228 | linux_latest = ["linux_4_11" ] |
229 | |
230 | # Enable features which depend on the Rust global allocator, such as functions |
231 | # that return owned strings or `Vec`s. |
232 | alloc = [] |
233 | |
234 | # This is used in the port of std to rustix. This is experimental and not meant |
235 | # for regular use. |
236 | rustc-dep-of-std = [ |
237 | "dep:core" , |
238 | "dep:alloc" , |
239 | "dep:compiler_builtins" , |
240 | "linux-raw-sys/rustc-dep-of-std" , |
241 | "bitflags/rustc-dep-of-std" , |
242 | "compiler_builtins?/rustc-dep-of-std" , |
243 | ] |
244 | |
245 | # Obsolete and deprecated. |
246 | cc = [] |
247 | |