1 | [package] |
2 | name = "rustix" |
3 | version = "0.37.27" |
4 | authors = [ |
5 | "Dan Gohman <dev@sunfishcode.online>" , |
6 | "Jakub Konka <kubkon@jakubkonka.com>" , |
7 | ] |
8 | description = "Safe Rust bindings to POSIX/Unix/Linux/Winsock2-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 = "2018" |
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.48" |
17 | |
18 | [build-dependencies] |
19 | cc = { version = "1.0.68" , optional = true } |
20 | |
21 | [dependencies] |
22 | bitflags = "1.3.2" |
23 | itoa = { version = "1.0.1" , default-features = false, optional = true } |
24 | io-lifetimes = { version = "1.0.10" , default-features = false, features = ["close" ], optional = true } |
25 | |
26 | # Special dependencies used in rustc-dep-of-std mode. |
27 | core = { version = "1.0.0" , optional = true, package = "rustc-std-workspace-core" } |
28 | alloc = { version = "1.0.0" , optional = true, package = "rustc-std-workspace-alloc" } |
29 | compiler_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] |
33 | once_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] |
42 | linux-raw-sys = { version = "0.3.6" , default-features = false, features = ["general" , "errno" , "ioctl" , "no_std" ] } |
43 | libc_errno = { package = "errno" , version = "0.3.1" , default-features = false, optional = true } |
44 | libc = { version = "0.2.144" , 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(all(not(windows), 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] |
51 | libc_errno = { package = "errno" , version = "0.3.1" , default-features = false } |
52 | libc = { version = "0.2.144" , 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] |
59 | linux-raw-sys = { version = "0.3.6" , default-features = false, features = ["general" , "ioctl" , "no_std" ] } |
60 | |
61 | # For the libc backend on Windows, use the Winsock2 API in windows-sys. |
62 | [target.'cfg(windows)'.dependencies.windows-sys] |
63 | version = "0.48.0" |
64 | features = [ |
65 | "Win32_Foundation" , |
66 | "Win32_Networking_WinSock" , |
67 | "Win32_NetworkManagement_IpHelper" , |
68 | "Win32_System_Threading" |
69 | ] |
70 | |
71 | # For the libc backend on Windows, also use the errno crate, which has Windows |
72 | # support. |
73 | [target.'cfg(windows)'.dependencies.libc_errno] |
74 | version = "0.3.1" |
75 | package = "errno" |
76 | default-features = false |
77 | |
78 | [dev-dependencies] |
79 | tempfile = "3.4.0" |
80 | libc = "0.2.144" |
81 | libc_errno = { package = "errno" , version = "0.3.1" , default-features = false } |
82 | io-lifetimes = { version = "1.0.10" , default-features = false, features = ["close" ] } |
83 | memoffset = "0.9.0" |
84 | flate2 = "1.0" |
85 | |
86 | [target.'cfg(windows)'.dev-dependencies] |
87 | ctor = "0.2.0" |
88 | |
89 | [package.metadata.docs.rs] |
90 | features = ["all-apis" ] |
91 | rustdoc-args = ["--cfg" , "doc_cfg" ] |
92 | targets = [ |
93 | "x86_64-unknown-linux-gnu" , |
94 | "i686-unknown-linux-gnu" , |
95 | "x86_64-apple-darwin" , |
96 | "x86_64-pc-windows-msvc" , |
97 | "x86_64-unknown-freebsd" , |
98 | "x86_64-unknown-openbsd" , |
99 | "x86_64-unknown-netbsd" , |
100 | "x86_64-unknown-dragonfly" , |
101 | "x86_64-unknown-illumos" , |
102 | "x86_64-unknown-redox" , |
103 | "x86_64-unknown-haiku" , |
104 | "wasm32-unknown-emscripten" , |
105 | "wasm32-wasi" , |
106 | ] |
107 | |
108 | [features] |
109 | |
110 | # By default, use `std` and use libc for aux values. |
111 | # |
112 | # It turns out to be bizarrely awkward to obtain the aux values reliably and |
113 | # efficiently on Linux from anywhere other than libc. We can do it, but most |
114 | # users are better served by just using libc for this. |
115 | default = ["std" , "use-libc-auxv" ] |
116 | |
117 | # This enables use of std. Disabling this enables `#![no_std], and requires |
118 | # Rust 1.64 or newer. |
119 | std = ["io-lifetimes" ] |
120 | |
121 | # This is used in the port of std to rustix. |
122 | rustc-dep-of-std = [ |
123 | "core" , |
124 | "alloc" , |
125 | "compiler_builtins" , |
126 | "linux-raw-sys/rustc-dep-of-std" , |
127 | "bitflags/rustc-dep-of-std" , |
128 | ] |
129 | |
130 | # Enable this to request the libc backend. |
131 | use-libc = ["libc_errno" , "libc" ] |
132 | |
133 | # Enable `rustix::fs::*`. |
134 | fs = [] |
135 | |
136 | # Enable `rustix::io_uring::*` (on platforms that support it). |
137 | io_uring = ["fs" , "net" ] |
138 | |
139 | # Enable `rustix::net::*`. |
140 | net = [] |
141 | |
142 | # Enable `rustix::thread::*`. |
143 | thread = [] |
144 | |
145 | # Enable `rustix::process::*`. |
146 | process = [] |
147 | |
148 | # Enable `rustix::time::*`. |
149 | time = [] |
150 | |
151 | # Enable `rustix::param::*`. |
152 | param = ["fs" ] |
153 | |
154 | # Enable this to enable `rustix::io::proc_self_*` (on Linux) and `ttyname`. |
155 | procfs = ["once_cell" , "itoa" , "fs" ] |
156 | |
157 | # Enable `rustix::pty::*`. |
158 | pty = ["itoa" , "fs" ] |
159 | |
160 | # Enable `rustix::termios::*`. |
161 | termios = [] |
162 | |
163 | # Enable `rustix::mm::*`. |
164 | mm = [] |
165 | |
166 | # Enable `rustix::rand::*`. |
167 | rand = [] |
168 | |
169 | # Enable `rustix::runtime::*`. This API is undocumented and unstable and |
170 | # experimental and not intended for general-purpose use. |
171 | runtime = [] |
172 | |
173 | # Enable all API features. |
174 | all-apis = [ |
175 | "fs" , |
176 | "io_uring" , |
177 | "mm" , |
178 | "net" , |
179 | "param" , |
180 | "process" , |
181 | "procfs" , |
182 | "pty" , |
183 | "rand" , |
184 | "runtime" , |
185 | "termios" , |
186 | "thread" , |
187 | "time" , |
188 | ] |
189 | |
190 | # When using the linux_raw backend, and not using Mustang, should we use libc |
191 | # for reading the aux vectors, instead of reading them ourselves from |
192 | # /proc/self/auxv? |
193 | use-libc-auxv = ["libc" ] |
194 | |
195 | # Expose io-lifetimes' features for third-party crate impls. |
196 | # Some of these are temporarily disabled, until the upstream crates add the |
197 | # needed trait implementations. |
198 | #async-std = ["io-lifetimes/async-std"] |
199 | #tokio = ["io-lifetimes/tokio"] |
200 | os_pipe = ["io-lifetimes/os_pipe" ] |
201 | #socket2 = ["io-lifetimes/socket2"] |
202 | #mio = ["io-lifetimes/mio"] |
203 | fs-err = ["io-lifetimes/fs-err" ] |
204 | #all-impls = ["async-std", "tokio", "os_pipe", "socket2", "mio", "fs-err"] |
205 | all-impls = ["os_pipe" , "fs-err" ] |
206 | |
207 | # OS compatability features |
208 | |
209 | # Optimize for Linux 4.11 or later |
210 | linux_4_11 = [] |
211 | |
212 | # Enable all optimizations for the latest Linux versions. |
213 | linux_latest = ["linux_4_11" ] |
214 | |