From 48a5f14f8a15e7f87877a8c33bfe90b6b6e8be6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Medina?= Date: Sun, 16 Jul 2023 12:02:57 -0700 Subject: [PATCH] Replace std::os::unix::io for std::os::fd This is just taking https://github.com/aya-rs/aya/pull/633 to its logical conclusion. Because `std::os::fd` was only introduced as a module in Rust v1.66.0 I have also updated the `Cargo.toml` of the `aya` package to reflect the true MSRV. Note that this commit is *not* the cause for this MSRV bump, that was done by a previous commit, this commit is just making it explicit in the `Cargo.toml` --- aya/Cargo.toml | 1 + aya/src/bpf.rs | 2 +- aya/src/maps/perf/perf_buffer.rs | 2 +- aya/src/maps/perf/perf_event_array.rs | 6 +++--- aya/src/maps/sock/mod.rs | 2 +- aya/src/maps/sock/sock_hash.rs | 4 ++-- aya/src/programs/links.rs | 2 +- aya/src/programs/perf_attach.rs | 2 +- aya/src/programs/sk_msg.rs | 4 ++-- aya/src/programs/sk_skb.rs | 2 +- aya/src/programs/sock_ops.rs | 2 +- aya/src/programs/socket_filter.rs | 2 +- aya/src/programs/utils.rs | 2 +- aya/src/programs/xdp.rs | 2 +- aya/src/sys/netlink.rs | 2 +- 15 files changed, 19 insertions(+), 18 deletions(-) diff --git a/aya/Cargo.toml b/aya/Cargo.toml index 9adf07c0..4e5eec16 100644 --- a/aya/Cargo.toml +++ b/aya/Cargo.toml @@ -9,6 +9,7 @@ repository = "https://github.com/aya-rs/aya" readme = "README.md" documentation = "https://docs.rs/aya" edition = "2021" +rust-version = "1.66" [dependencies] async-io = { workspace = true, optional = true } diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index 90e33488..818a063b 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -3,7 +3,7 @@ use std::{ collections::{HashMap, HashSet}, ffi::CString, fs, io, - os::{raw::c_int, unix::io::RawFd}, + os::{fd::RawFd, raw::c_int}, path::{Path, PathBuf}, }; diff --git a/aya/src/maps/perf/perf_buffer.rs b/aya/src/maps/perf/perf_buffer.rs index e3e99e3e..19813557 100644 --- a/aya/src/maps/perf/perf_buffer.rs +++ b/aya/src/maps/perf/perf_buffer.rs @@ -1,7 +1,7 @@ use std::{ ffi::c_void, io, mem, - os::unix::io::{AsRawFd, RawFd}, + os::fd::{AsRawFd, RawFd}, ptr, slice, sync::atomic::{self, AtomicPtr, Ordering}, }; diff --git a/aya/src/maps/perf/perf_event_array.rs b/aya/src/maps/perf/perf_event_array.rs index c241a37b..3d6a8103 100644 --- a/aya/src/maps/perf/perf_event_array.rs +++ b/aya/src/maps/perf/perf_event_array.rs @@ -4,7 +4,7 @@ use std::{ borrow::{Borrow, BorrowMut}, ops::Deref, - os::unix::io::{AsRawFd, RawFd}, + os::fd::{AsRawFd, RawFd}, sync::Arc, }; @@ -64,7 +64,7 @@ impl + Borrow> AsRawFd for PerfEventArrayBuffer + Borrow> AsRawFd for PerfEventArrayBuffer