2014-08-07 20:02:28 +00:00
|
|
|
[package]
|
2015-01-05 08:30:07 +00:00
|
|
|
name = "nix"
|
2015-02-21 00:43:26 +00:00
|
|
|
description = "Rust friendly bindings to *nix APIs"
|
2020-05-31 21:17:16 +00:00
|
|
|
edition = "2018"
|
2022-04-22 23:46:23 +00:00
|
|
|
version = "0.24.1"
|
2021-10-15 21:52:05 +00:00
|
|
|
rust-version = "1.46"
|
2016-10-24 16:55:08 +00:00
|
|
|
authors = ["The nix-rust Project Developers"]
|
2016-04-07 14:29:16 +00:00
|
|
|
repository = "https://github.com/nix-rust/nix"
|
2015-01-05 08:30:07 +00:00
|
|
|
license = "MIT"
|
2017-01-20 16:56:42 +00:00
|
|
|
categories = ["os::unix-apis"]
|
2021-11-17 10:20:40 +00:00
|
|
|
include = ["src/**/*", "test/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
|
2015-01-16 13:59:27 +00:00
|
|
|
|
2020-11-17 20:33:38 +00:00
|
|
|
[package.metadata.docs.rs]
|
2020-03-19 10:40:53 +00:00
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
2020-11-17 20:33:38 +00:00
|
|
|
targets = [
|
|
|
|
"x86_64-unknown-linux-gnu",
|
|
|
|
"aarch64-linux-android",
|
|
|
|
"x86_64-apple-darwin",
|
|
|
|
"aarch64-apple-ios",
|
|
|
|
"x86_64-unknown-freebsd",
|
|
|
|
"x86_64-unknown-openbsd",
|
|
|
|
"x86_64-unknown-netbsd",
|
|
|
|
"x86_64-unknown-dragonfly",
|
2020-08-05 17:25:03 +00:00
|
|
|
"x86_64-fuchsia",
|
2020-06-17 01:11:05 +00:00
|
|
|
"x86_64-unknown-redox",
|
|
|
|
"x86_64-unknown-illumos"
|
2020-11-17 20:33:38 +00:00
|
|
|
]
|
|
|
|
|
2015-01-16 13:59:27 +00:00
|
|
|
[dependencies]
|
2022-05-29 19:10:50 +00:00
|
|
|
libc = { version = "0.2.126", features = [ "extra_traits" ] }
|
2021-12-15 04:30:34 +00:00
|
|
|
bitflags = "1.1"
|
2020-10-12 18:17:26 +00:00
|
|
|
cfg-if = "1.0"
|
Rewrite the aio module
The existing AIO implementation has some problems:
1) The in_progress field is checked at runtime, not compile time.
2) The mutable field is checked at runtime, not compile time.
3) A downstream lio_listio user must store extra state to track whether
the whole operation is partially, completely, or not at all
submitted.
4) Nix does heap allocation itself, rather than allowing the caller to
choose it. This can result in double (or triple, or quadruple)
boxing.
5) There's no easy way to use lio_listio to submit multiple operations with
a single syscall, but poll each individually.
6) The lio_listio usage is far from transparent and zero-cost.
7) No aio_readv or aio_writev support.
8) priority has type c_int; should be i32
9) aio_return should return a usize instead of an isize, since it only
uses negative values to indicate errors, which Rust represents via
the Result type.
This rewrite solves several problems:
1) Unsolved. I don't think it can be solved without something like
C++'s guaranteed type elision. It might require changing the
signature of Future::poll too.
2) Solved.
3) Solved, by the new in_progress method and by removing the complicated
lio_listio resubmit code.
4) Solved.
5) Solved.
6) Solved, by removing the lio_listo resubmit code. It can be
reimplemented downstream if necessary. Or even in Nix, but it
doesn't fit Nix's theme of zero-cost abstractions.
7) Solved.
8) Solved.
9) Solved.
The rewrite includes functions that don't work on FreeBSD, so add CI
testing for FreeBSD 14 too.
By default only enable tests that will pass on FreeBSD 12.3. But run a
CI job on FreeBSD 14 and set a flag that will enable such tests.
2022-04-30 20:10:28 +00:00
|
|
|
pin-utils = { version = "0.1.0", optional = true }
|
2015-02-11 06:19:04 +00:00
|
|
|
|
2021-04-04 14:39:05 +00:00
|
|
|
[target.'cfg(not(target_os = "redox"))'.dependencies]
|
2022-01-23 20:52:02 +00:00
|
|
|
memoffset = { version = "0.6.3", optional = true }
|
2021-04-04 14:39:05 +00:00
|
|
|
|
2022-04-08 04:17:37 +00:00
|
|
|
[build-dependencies]
|
|
|
|
autocfg = "1.1.0"
|
|
|
|
|
2020-03-19 10:40:53 +00:00
|
|
|
[features]
|
|
|
|
default = [
|
2022-04-09 22:32:39 +00:00
|
|
|
"acct", "aio", "dir", "env", "event", "feature", "fs",
|
2020-03-19 10:40:53 +00:00
|
|
|
"hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue",
|
|
|
|
"net", "personality", "poll", "process", "pthread", "ptrace", "quota",
|
|
|
|
"reboot", "resource", "sched", "signal", "socket", "term", "time",
|
2022-04-09 22:32:39 +00:00
|
|
|
"ucontext", "uio", "user", "zerocopy",
|
2020-03-19 10:40:53 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
acct = []
|
Rewrite the aio module
The existing AIO implementation has some problems:
1) The in_progress field is checked at runtime, not compile time.
2) The mutable field is checked at runtime, not compile time.
3) A downstream lio_listio user must store extra state to track whether
the whole operation is partially, completely, or not at all
submitted.
4) Nix does heap allocation itself, rather than allowing the caller to
choose it. This can result in double (or triple, or quadruple)
boxing.
5) There's no easy way to use lio_listio to submit multiple operations with
a single syscall, but poll each individually.
6) The lio_listio usage is far from transparent and zero-cost.
7) No aio_readv or aio_writev support.
8) priority has type c_int; should be i32
9) aio_return should return a usize instead of an isize, since it only
uses negative values to indicate errors, which Rust represents via
the Result type.
This rewrite solves several problems:
1) Unsolved. I don't think it can be solved without something like
C++'s guaranteed type elision. It might require changing the
signature of Future::poll too.
2) Solved.
3) Solved, by the new in_progress method and by removing the complicated
lio_listio resubmit code.
4) Solved.
5) Solved.
6) Solved, by removing the lio_listo resubmit code. It can be
reimplemented downstream if necessary. Or even in Nix, but it
doesn't fit Nix's theme of zero-cost abstractions.
7) Solved.
8) Solved.
9) Solved.
The rewrite includes functions that don't work on FreeBSD, so add CI
testing for FreeBSD 14 too.
By default only enable tests that will pass on FreeBSD 12.3. But run a
CI job on FreeBSD 14 and set a flag that will enable such tests.
2022-04-30 20:10:28 +00:00
|
|
|
aio = ["pin-utils"]
|
2020-03-19 10:40:53 +00:00
|
|
|
dir = ["fs"]
|
|
|
|
env = []
|
|
|
|
event = []
|
2022-04-09 22:32:39 +00:00
|
|
|
feature = []
|
2020-03-19 10:40:53 +00:00
|
|
|
fs = []
|
|
|
|
hostname = []
|
|
|
|
inotify = []
|
|
|
|
ioctl = []
|
|
|
|
kmod = []
|
|
|
|
mman = []
|
|
|
|
mount = ["uio"]
|
|
|
|
mqueue = ["fs"]
|
|
|
|
net = ["socket"]
|
|
|
|
personality = []
|
|
|
|
poll = []
|
|
|
|
pthread = []
|
|
|
|
ptrace = ["process"]
|
|
|
|
quota = []
|
|
|
|
process = []
|
|
|
|
reboot = []
|
|
|
|
resource = []
|
|
|
|
sched = ["process"]
|
|
|
|
signal = ["process"]
|
2022-01-23 20:52:02 +00:00
|
|
|
socket = ["memoffset"]
|
2020-03-19 10:40:53 +00:00
|
|
|
term = []
|
|
|
|
time = []
|
|
|
|
ucontext = ["signal"]
|
|
|
|
uio = []
|
2022-04-09 22:32:39 +00:00
|
|
|
user = ["feature"]
|
2020-03-19 10:40:53 +00:00
|
|
|
zerocopy = ["fs", "uio"]
|
|
|
|
|
2015-02-11 06:19:04 +00:00
|
|
|
[dev-dependencies]
|
2021-05-30 16:47:05 +00:00
|
|
|
assert-impl = "0.1"
|
2022-04-25 02:14:01 +00:00
|
|
|
lazy_static = "1.4"
|
2021-11-27 19:50:29 +00:00
|
|
|
parking_lot = "0.11.2"
|
2021-02-20 21:56:36 +00:00
|
|
|
rand = "0.8"
|
2022-04-25 02:14:01 +00:00
|
|
|
tempfile = "3.3.0"
|
|
|
|
semver = "1.0.7"
|
2015-02-21 22:33:27 +00:00
|
|
|
|
2019-05-26 23:47:49 +00:00
|
|
|
[target.'cfg(any(target_os = "android", target_os = "linux"))'.dev-dependencies]
|
2022-04-25 02:14:01 +00:00
|
|
|
caps = "0.5.3"
|
2019-05-26 23:47:49 +00:00
|
|
|
|
2018-03-22 15:44:54 +00:00
|
|
|
[target.'cfg(target_os = "freebsd")'.dev-dependencies]
|
2022-04-25 00:04:23 +00:00
|
|
|
sysctl = "0.4"
|
2018-03-22 15:44:54 +00:00
|
|
|
|
2015-02-21 22:33:27 +00:00
|
|
|
[[test]]
|
|
|
|
name = "test"
|
|
|
|
path = "test/test.rs"
|
2015-09-03 19:20:53 +00:00
|
|
|
|
2017-09-03 20:27:20 +00:00
|
|
|
[[test]]
|
|
|
|
name = "test-aio-drop"
|
|
|
|
path = "test/sys/test_aio_drop.rs"
|
|
|
|
|
2020-02-11 02:37:33 +00:00
|
|
|
[[test]]
|
|
|
|
name = "test-clearenv"
|
|
|
|
path = "test/test_clearenv.rs"
|
|
|
|
|
2016-01-01 19:24:46 +00:00
|
|
|
[[test]]
|
|
|
|
name = "test-mount"
|
|
|
|
path = "test/test_mount.rs"
|
|
|
|
harness = false
|
2017-07-15 16:47:58 +00:00
|
|
|
|
2020-05-31 21:35:30 +00:00
|
|
|
[[test]]
|
2017-07-15 16:47:58 +00:00
|
|
|
name = "test-ptymaster-drop"
|
|
|
|
path = "test/test_ptymaster_drop.rs"
|