Skip to content

Commit

Permalink
m: Remove libc from our dependencies
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
notgull authored Aug 14, 2023
1 parent c6a0890 commit e42664d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
2 changes: 1 addition & 1 deletion src/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Expand Down
3 changes: 1 addition & 2 deletions src/kqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e42664d

Please sign in to comment.