m: Remove libc from our dependencies

This means that we only depend on rustix, so all of the system calls
are direct. This should make mustang integration trivial.

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2023-08-13 18:49:43 -07:00 committed by GitHub
parent c6a0890627
commit e42664d57e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -26,8 +26,7 @@ cfg-if = "1"
tracing = { version = "0.1.37", default-features = false }
[target.'cfg(any(unix, target_os = "fuchsia", target_os = "vxworks"))'.dependencies]
libc = "0.2.77"
rustix = { version = "0.38", features = ["event", "fs", "pipe", "process", "std", "time"], default-features = false }
rustix = { version = "0.38.8", features = ["event", "fs", "pipe", "process", "std", "time"], default-features = false }
[target.'cfg(windows)'.dependencies]
concurrent-queue = "2.2.0"
@ -49,3 +48,6 @@ features = [
[dev-dependencies]
easy-parallel = "3.1.0"
fastrand = "2.0.0"
[target.'cfg(any(unix, target_os = "fuchsia", target_os = "vxworks"))'.dev_dependencies]
libc = "0.2"

View File

@ -165,7 +165,7 @@ impl Poller {
Some(t) => {
let mut ts = TS_ZERO;
ts.tv_sec = t.as_secs() as _;
ts.tv_nsec = (t.subsec_nanos() as libc::c_long).into();
ts.tv_nsec = t.subsec_nanos() as _;
ts
}
},

View File

@ -128,8 +128,7 @@ impl Poller {
// Check for errors.
for &ev in &eventlist {
// TODO: Once the data field is exposed in rustix, use that.
let data = unsafe { (*(&ev as *const kqueue::Event as *const libc::kevent)).data };
let data = ev.data();
// Explanation for ignoring EPIPE: https://github.com/tokio-rs/mio/issues/582
if (ev.flags().contains(kqueue::EventFlags::ERROR))