From bb6c27b83a44794735c7951358188d0e479340d9 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 10 Aug 2023 14:37:08 -0400 Subject: [PATCH] programs: `ProgramFd` is borrowed from the program `ProgramData::fd` is now owned. This means that `ProgramData` now closes the file descriptor on drop. Updates #612. --- aya/src/maps/array/program_array.rs | 12 +- aya/src/programs/cgroup_device.rs | 1 + aya/src/programs/cgroup_skb.rs | 1 + aya/src/programs/cgroup_sock.rs | 1 + aya/src/programs/cgroup_sock_addr.rs | 1 + aya/src/programs/cgroup_sockopt.rs | 1 + aya/src/programs/cgroup_sysctl.rs | 1 + aya/src/programs/extension.rs | 56 +++++++--- aya/src/programs/lirc_mode2.rs | 7 +- aya/src/programs/mod.rs | 45 ++++---- aya/src/programs/perf_event.rs | 6 +- aya/src/programs/probe.rs | 23 ++-- aya/src/programs/sk_lookup.rs | 1 + aya/src/programs/sk_msg.rs | 1 + aya/src/programs/sk_skb.rs | 1 + aya/src/programs/sock_ops.rs | 1 + aya/src/programs/socket_filter.rs | 1 + aya/src/programs/tc.rs | 2 + aya/src/programs/trace_point.rs | 10 +- aya/src/programs/utils.rs | 4 +- aya/src/programs/xdp.rs | 4 +- aya/src/sys/bpf.rs | 8 +- xtask/public-api/aya.txt | 160 +++++++++++++-------------- 23 files changed, 198 insertions(+), 150 deletions(-) diff --git a/aya/src/maps/array/program_array.rs b/aya/src/maps/array/program_array.rs index b7ec75cfb..216a8ed73 100644 --- a/aya/src/maps/array/program_array.rs +++ b/aya/src/maps/array/program_array.rs @@ -2,7 +2,7 @@ use std::{ borrow::{Borrow, BorrowMut}, - os::fd::{AsRawFd, RawFd}, + os::fd::{AsFd as _, AsRawFd as _, RawFd}, }; use crate::{ @@ -77,14 +77,14 @@ impl> ProgramArray { let data = self.inner.borrow_mut(); check_bounds(data, index)?; let fd = data.fd_or_err()?; - let prog_fd = program.as_raw_fd(); + let prog_fd = program.as_fd(); - bpf_map_update_elem(fd, Some(&index), &prog_fd, flags).map_err(|(_, io_error)| { - SyscallError { + bpf_map_update_elem(fd, Some(&index), &prog_fd.as_raw_fd(), flags).map_err( + |(_, io_error)| SyscallError { call: "bpf_map_update_elem", io_error, - } - })?; + }, + )?; Ok(()) } diff --git a/aya/src/programs/cgroup_device.rs b/aya/src/programs/cgroup_device.rs index dc3180860..41d6c2c0d 100644 --- a/aya/src/programs/cgroup_device.rs +++ b/aya/src/programs/cgroup_device.rs @@ -62,6 +62,7 @@ impl CgroupDevice { /// The returned value can be used to detach, see [CgroupDevice::detach] pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); if KernelVersion::current().unwrap() >= KernelVersion::new(5, 7, 0) { diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs index d0cda14a8..f35617b72 100644 --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -89,6 +89,7 @@ impl CgroupSkb { attach_type: CgroupSkbAttachType, ) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); let attach_type = match attach_type { diff --git a/aya/src/programs/cgroup_sock.rs b/aya/src/programs/cgroup_sock.rs index a7a70e130..ebe14f117 100644 --- a/aya/src/programs/cgroup_sock.rs +++ b/aya/src/programs/cgroup_sock.rs @@ -68,6 +68,7 @@ impl CgroupSock { /// The returned value can be used to detach, see [CgroupSock::detach]. pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); let attach_type = self.data.expected_attach_type.unwrap(); if KernelVersion::current().unwrap() >= KernelVersion::new(5, 7, 0) { diff --git a/aya/src/programs/cgroup_sock_addr.rs b/aya/src/programs/cgroup_sock_addr.rs index 827cbe575..e7b3fbe2c 100644 --- a/aya/src/programs/cgroup_sock_addr.rs +++ b/aya/src/programs/cgroup_sock_addr.rs @@ -69,6 +69,7 @@ impl CgroupSockAddr { /// The returned value can be used to detach, see [CgroupSockAddr::detach]. pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); let attach_type = self.data.expected_attach_type.unwrap(); if KernelVersion::current().unwrap() >= KernelVersion::new(5, 7, 0) { diff --git a/aya/src/programs/cgroup_sockopt.rs b/aya/src/programs/cgroup_sockopt.rs index e2ae3b641..275229a8a 100644 --- a/aya/src/programs/cgroup_sockopt.rs +++ b/aya/src/programs/cgroup_sockopt.rs @@ -66,6 +66,7 @@ impl CgroupSockopt { /// The returned value can be used to detach, see [CgroupSockopt::detach]. pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); let attach_type = self.data.expected_attach_type.unwrap(); if KernelVersion::current().unwrap() >= KernelVersion::new(5, 7, 0) { diff --git a/aya/src/programs/cgroup_sysctl.rs b/aya/src/programs/cgroup_sysctl.rs index 8e8876573..ce4f822fe 100644 --- a/aya/src/programs/cgroup_sysctl.rs +++ b/aya/src/programs/cgroup_sysctl.rs @@ -61,6 +61,7 @@ impl CgroupSysctl { /// The returned value can be used to detach, see [CgroupSysctl::detach]. pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); if KernelVersion::current().unwrap() >= KernelVersion::new(5, 7, 0) { diff --git a/aya/src/programs/extension.rs b/aya/src/programs/extension.rs index 143c909f4..8b3eb2358 100644 --- a/aya/src/programs/extension.rs +++ b/aya/src/programs/extension.rs @@ -1,5 +1,5 @@ //! Extension programs. -use std::os::fd::{AsRawFd, RawFd}; +use std::os::fd::{AsFd as _, AsRawFd as _, BorrowedFd, RawFd}; use thiserror::Error; use object::Endianness; @@ -37,12 +37,22 @@ pub enum ExtensionError { /// use aya::{BpfLoader, programs::{Xdp, XdpFlags, Extension}}; /// /// let mut bpf = BpfLoader::new().extension("extension").load_file("app.o")?; -/// let prog: &mut Xdp = bpf.program_mut("main").unwrap().try_into()?; +/// let mut prog = None; +/// let mut ext = None; +/// for (name, program) in bpf.programs_mut() { +/// match name { +/// "main" => prog = Some(program), +/// "extension" => ext = Some(program), +/// _ => {}, +/// } +/// } +/// +/// let prog: &mut Xdp = prog.unwrap().try_into()?; /// prog.load()?; /// prog.attach("eth0", XdpFlags::default())?; /// /// let prog_fd = prog.fd().unwrap(); -/// let ext: &mut Extension = bpf.program_mut("extension").unwrap().try_into()?; +/// let ext: &mut Extension = ext.unwrap().try_into()?; /// ext.load(prog_fd, "function_to_replace")?; /// ext.attach()?; /// Ok::<(), aya::BpfError>(()) @@ -69,11 +79,11 @@ impl Extension { /// There are no restrictions on what functions may be replaced, so you could replace /// the main entry point of your program with an extension. pub fn load(&mut self, program: ProgramFd, func_name: &str) -> Result<(), ProgramError> { - let target_prog_fd = program.as_raw_fd(); + let target_prog_fd = program.as_fd(); let (btf_fd, btf_id) = get_btf_info(target_prog_fd, func_name)?; self.data.attach_btf_obj_fd = Some(btf_fd as u32); - self.data.attach_prog_fd = Some(target_prog_fd); + self.data.attach_prog_fd = Some(target_prog_fd.as_raw_fd()); self.data.attach_btf_id = Some(btf_id); load_program(BPF_PROG_TYPE_EXT, &mut self.data) } @@ -90,11 +100,17 @@ impl Extension { let target_fd = self.data.attach_prog_fd.ok_or(ProgramError::NotLoaded)?; let btf_id = self.data.attach_btf_id.ok_or(ProgramError::NotLoaded)?; // the attach type must be set as 0, which is bpf_attach_type::BPF_CGROUP_INET_INGRESS - let link_fd = bpf_link_create(prog_fd, target_fd, BPF_CGROUP_INET_INGRESS, Some(btf_id), 0) - .map_err(|(_, io_error)| SyscallError { - call: "bpf_link_create", - io_error, - })?; + let link_fd = bpf_link_create( + prog_fd.as_raw_fd(), + target_fd, + BPF_CGROUP_INET_INGRESS, + Some(btf_id), + 0, + ) + .map_err(|(_, io_error)| SyscallError { + call: "bpf_link_create", + io_error, + })?; self.data .links .insert(ExtensionLink::new(FdLink::new(link_fd))) @@ -116,15 +132,21 @@ impl Extension { program: ProgramFd, func_name: &str, ) -> Result { - let target_fd = program.as_raw_fd(); + let target_fd = program.as_fd(); let (_, btf_id) = get_btf_info(target_fd, func_name)?; let prog_fd = self.data.fd_or_err()?; // the attach type must be set as 0, which is bpf_attach_type::BPF_CGROUP_INET_INGRESS - let link_fd = bpf_link_create(prog_fd, target_fd, BPF_CGROUP_INET_INGRESS, Some(btf_id), 0) - .map_err(|(_, io_error)| SyscallError { - call: "bpf_link_create", - io_error, - })?; + let link_fd = bpf_link_create( + prog_fd.as_raw_fd(), + target_fd.as_raw_fd(), + BPF_CGROUP_INET_INGRESS, + Some(btf_id), + 0, + ) + .map_err(|(_, io_error)| SyscallError { + call: "bpf_link_create", + io_error, + })?; self.data .links .insert(ExtensionLink::new(FdLink::new(link_fd))) @@ -149,7 +171,7 @@ impl Extension { /// Retrieves the FD of the BTF object for the provided `prog_fd` and the BTF ID of the function /// with the name `func_name` within that BTF object. -fn get_btf_info(prog_fd: i32, func_name: &str) -> Result<(RawFd, u32), ProgramError> { +fn get_btf_info(prog_fd: BorrowedFd<'_>, func_name: &str) -> Result<(RawFd, u32), ProgramError> { // retrieve program information let info = sys::bpf_prog_get_info_by_fd(prog_fd)?; diff --git a/aya/src/programs/lirc_mode2.rs b/aya/src/programs/lirc_mode2.rs index e39bbf1a4..a577002c0 100644 --- a/aya/src/programs/lirc_mode2.rs +++ b/aya/src/programs/lirc_mode2.rs @@ -1,5 +1,5 @@ //! Lirc programs. -use std::os::fd::{AsRawFd, IntoRawFd as _, RawFd}; +use std::os::fd::{AsRawFd, BorrowedFd, IntoRawFd as _, RawFd}; use crate::{ generated::{bpf_attach_type::BPF_LIRC_MODE2, bpf_prog_type::BPF_PROG_TYPE_LIRC_MODE2}, @@ -65,6 +65,7 @@ impl LircMode2 { /// The returned value can be used to detach, see [LircMode2::detach]. pub fn attach(&mut self, lircdev: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let lircdev_fd = lircdev.as_raw_fd(); bpf_prog_attach(prog_fd, lircdev_fd, BPF_LIRC_MODE2).map_err(|(_, io_error)| { @@ -131,7 +132,9 @@ impl LircLink { /// Get ProgramInfo from this link pub fn info(&self) -> Result { - bpf_prog_get_info_by_fd(self.prog_fd) + // SAFETY: TODO(https://github.com/aya-rs/aya/issues/612): make this safe by not holding `RawFd`s. + let prog_fd = unsafe { BorrowedFd::borrow_raw(self.prog_fd) }; + bpf_prog_get_info_by_fd(prog_fd) .map(ProgramInfo) .map_err(Into::into) } diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index eab30abe5..9acb02574 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -68,7 +68,7 @@ use libc::ENOSPC; use std::{ ffi::CString, io, - os::fd::{AsFd, AsRawFd, IntoRawFd as _, OwnedFd, RawFd}, + os::fd::{AsFd, AsRawFd, BorrowedFd, IntoRawFd as _, OwnedFd, RawFd}, path::{Path, PathBuf}, sync::Arc, }; @@ -212,11 +212,12 @@ pub enum ProgramError { /// A [`Program`] file descriptor. #[derive(Copy, Clone)] -pub struct ProgramFd(RawFd); +pub struct ProgramFd<'program>(BorrowedFd<'program>); -impl AsRawFd for ProgramFd { - fn as_raw_fd(&self) -> RawFd { - self.0 +impl AsFd for ProgramFd<'_> { + fn as_fd(&self) -> BorrowedFd<'_> { + let Self(fd) = self; + *fd } } @@ -403,7 +404,7 @@ impl Program { pub(crate) struct ProgramData { pub(crate) name: Option, pub(crate) obj: Option<(obj::Program, obj::Function)>, - pub(crate) fd: Option, + pub(crate) fd: Option, pub(crate) links: LinkMap, pub(crate) expected_attach_type: Option, pub(crate) attach_btf_obj_fd: Option, @@ -464,7 +465,7 @@ impl ProgramData { Ok(ProgramData { name, obj: None, - fd: Some(fd.into_raw_fd()), + fd: Some(fd), links: LinkMap::new(), expected_attach_type: None, attach_btf_obj_fd, @@ -488,15 +489,18 @@ impl ProgramData { io_error, })?; - let info = bpf_prog_get_info_by_fd(fd.as_raw_fd())?; + let info = bpf_prog_get_info_by_fd(fd.as_fd())?; let name = ProgramInfo(info).name_as_str().map(|s| s.to_string()); ProgramData::from_bpf_prog_info(name, fd, path.as_ref(), info, verifier_log_level) } } impl ProgramData { - fn fd_or_err(&self) -> Result { - self.fd.ok_or(ProgramError::NotLoaded) + fn fd_or_err(&self) -> Result, ProgramError> { + self.fd + .as_ref() + .map(AsFd::as_fd) + .ok_or(ProgramError::NotLoaded) } pub(crate) fn take_link(&mut self, link_id: T::Id) -> Result { @@ -506,15 +510,14 @@ impl ProgramData { fn unload_program(data: &mut ProgramData) -> Result<(), ProgramError> { data.links.remove_all()?; - let fd = data.fd.take().ok_or(ProgramError::NotLoaded)?; - unsafe { - libc::close(fd); - } - Ok(()) + data.fd + .take() + .ok_or(ProgramError::NotLoaded) + .map(|_: OwnedFd| ()) } fn pin_program>(data: &ProgramData, path: P) -> Result<(), PinError> { - let fd = data.fd.ok_or(PinError::NoFd { + let fd = data.fd.as_ref().ok_or(PinError::NoFd { name: data .name .as_deref() @@ -526,7 +529,7 @@ fn pin_program>(data: &ProgramData, path: P) -> Resul error: e.to_string(), } })?; - bpf_pin_object(fd, &path_string).map_err(|(_, io_error)| SyscallError { + bpf_pin_object(fd.as_raw_fd(), &path_string).map_err(|(_, io_error)| SyscallError { call: "BPF_OBJ_PIN", io_error, })?; @@ -620,7 +623,7 @@ fn load_program( match ret { Ok(prog_fd) => { - *fd = Some(prog_fd as RawFd); + *fd = Some(prog_fd); Ok(()) } Err((_, io_error)) => Err(ProgramError::LoadError { @@ -726,7 +729,7 @@ macro_rules! impl_fd { impl $struct_name { /// Returns the file descriptor of this Program. pub fn fd(&self) -> Option { - self.data.fd.map(|fd| ProgramFd(fd)) + self.data.fd.as_ref().map(|fd| ProgramFd(fd.as_fd())) } } )+ @@ -955,7 +958,7 @@ impl ProgramInfo { io_error, })?; - let info = bpf_prog_get_info_by_fd(fd.as_raw_fd())?; + let info = bpf_prog_get_info_by_fd(fd.as_fd())?; Ok(ProgramInfo(info)) } } @@ -991,7 +994,7 @@ pub fn loaded_programs() -> impl Iterator Result { + let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let (sample_period, sample_frequency) = match sample_policy { SamplePolicy::Period(period) => (period, None), SamplePolicy::Frequency(frequency) => (0, Some(frequency)), @@ -172,7 +174,7 @@ impl PerfEvent { io_error, })?; - let link = perf_attach(self.data.fd_or_err()?, fd)?; + let link = perf_attach(prog_fd, fd)?; self.data.links.insert(PerfEventLink::new(link)) } diff --git a/aya/src/programs/probe.rs b/aya/src/programs/probe.rs index fa04d31df..ac0ea6c55 100644 --- a/aya/src/programs/probe.rs +++ b/aya/src/programs/probe.rs @@ -3,7 +3,7 @@ use libc::pid_t; use std::{ fs::{self, OpenOptions}, io::{self, Write}, - os::fd::OwnedFd, + os::fd::{AsRawFd as _, OwnedFd}, path::Path, process, sync::atomic::{AtomicUsize, Ordering}, @@ -57,19 +57,16 @@ pub(crate) fn attach>( ) -> Result { // https://github.com/torvalds/linux/commit/e12f03d7031a977356e3d7b75a68c2185ff8d155 // Use debugfs to create probe - if KernelVersion::current().unwrap() < KernelVersion::new(4, 17, 0) { + let prog_fd = program_data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); + let link = if KernelVersion::current().unwrap() < KernelVersion::new(4, 17, 0) { let (fd, event_alias) = create_as_trace_point(kind, fn_name, offset, pid)?; - let link = T::from(perf_attach_debugfs( - program_data.fd_or_err()?, - fd, - ProbeEvent { kind, event_alias }, - )?); - return program_data.links.insert(link); - }; - - let fd = create_as_probe(kind, fn_name, offset, pid)?; - let link = T::from(perf_attach(program_data.fd_or_err()?, fd)?); - program_data.links.insert(link) + perf_attach_debugfs(prog_fd, fd, ProbeEvent { kind, event_alias }) + } else { + let fd = create_as_probe(kind, fn_name, offset, pid)?; + perf_attach(prog_fd, fd) + }?; + program_data.links.insert(T::from(link)) } pub(crate) fn detach_debug_fs(event: ProbeEvent) -> Result<(), ProgramError> { diff --git a/aya/src/programs/sk_lookup.rs b/aya/src/programs/sk_lookup.rs index 15687e437..0a6aac087 100644 --- a/aya/src/programs/sk_lookup.rs +++ b/aya/src/programs/sk_lookup.rs @@ -62,6 +62,7 @@ impl SkLookup { /// The returned value can be used to detach, see [SkLookup::detach]. pub fn attach(&mut self, netns: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let netns_fd = netns.as_raw_fd(); let link_fd = bpf_link_create(prog_fd, netns_fd, BPF_SK_LOOKUP, None, 0).map_err( diff --git a/aya/src/programs/sk_msg.rs b/aya/src/programs/sk_msg.rs index 93819fbe1..2b64dd9fd 100644 --- a/aya/src/programs/sk_msg.rs +++ b/aya/src/programs/sk_msg.rs @@ -80,6 +80,7 @@ impl SkMsg { /// The returned value can be used to detach, see [SkMsg::detach]. pub fn attach(&mut self, map: SockMapFd) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let map_fd = map.as_raw_fd(); bpf_prog_attach(prog_fd, map_fd, BPF_SK_MSG_VERDICT).map_err(|(_, io_error)| { diff --git a/aya/src/programs/sk_skb.rs b/aya/src/programs/sk_skb.rs index 709602650..660437592 100644 --- a/aya/src/programs/sk_skb.rs +++ b/aya/src/programs/sk_skb.rs @@ -73,6 +73,7 @@ impl SkSkb { /// The returned value can be used to detach, see [SkSkb::detach]. pub fn attach(&mut self, map: SockMapFd) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let map_fd = map.as_raw_fd(); let attach_type = match self.kind { diff --git a/aya/src/programs/sock_ops.rs b/aya/src/programs/sock_ops.rs index 16e716776..123448e41 100644 --- a/aya/src/programs/sock_ops.rs +++ b/aya/src/programs/sock_ops.rs @@ -60,6 +60,7 @@ impl SockOps { /// The returned value can be used to detach, see [SockOps::detach]. pub fn attach(&mut self, cgroup: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let cgroup_fd = cgroup.as_raw_fd(); bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS).map_err(|(_, io_error)| { diff --git a/aya/src/programs/socket_filter.rs b/aya/src/programs/socket_filter.rs index 5ff9a301f..479c2fcbc 100644 --- a/aya/src/programs/socket_filter.rs +++ b/aya/src/programs/socket_filter.rs @@ -74,6 +74,7 @@ impl SocketFilter { /// The returned value can be used to detach from the socket, see [SocketFilter::detach]. pub fn attach(&mut self, socket: T) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let socket = socket.as_raw_fd(); let ret = unsafe { diff --git a/aya/src/programs/tc.rs b/aya/src/programs/tc.rs index fad633a33..3405ce7b6 100644 --- a/aya/src/programs/tc.rs +++ b/aya/src/programs/tc.rs @@ -4,6 +4,7 @@ use thiserror::Error; use std::{ ffi::{CStr, CString}, io, + os::fd::AsRawFd as _, path::Path, }; @@ -153,6 +154,7 @@ impl SchedClassifier { options: TcOptions, ) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let if_index = ifindex_from_ifname(interface) .map_err(|io_error| TcError::NetlinkError { io_error })?; let (priority, handle) = unsafe { diff --git a/aya/src/programs/trace_point.rs b/aya/src/programs/trace_point.rs index 4e7b75b3d..efe2b4008 100644 --- a/aya/src/programs/trace_point.rs +++ b/aya/src/programs/trace_point.rs @@ -1,5 +1,9 @@ //! Tracepoint programs. -use std::{fs, io, os::fd::AsFd as _, path::Path}; +use std::{ + fs, io, + os::fd::{AsFd as _, AsRawFd as _}, + path::Path, +}; use thiserror::Error; use crate::{ @@ -78,6 +82,8 @@ impl TracePoint { /// /// The returned value can be used to detach, see [TracePoint::detach]. pub fn attach(&mut self, category: &str, name: &str) -> Result { + let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let tracefs = find_tracefs_path()?; let id = read_sys_fs_trace_point_id(tracefs, category, name)?; let fd = @@ -86,7 +92,7 @@ impl TracePoint { io_error, })?; - let link = perf_attach(self.data.fd_or_err()?, fd)?; + let link = perf_attach(prog_fd, fd)?; self.data.links.insert(TracePointLink::new(link)) } diff --git a/aya/src/programs/utils.rs b/aya/src/programs/utils.rs index 66f621428..fcfe90bb1 100644 --- a/aya/src/programs/utils.rs +++ b/aya/src/programs/utils.rs @@ -1,5 +1,5 @@ //! Common functions shared between multiple eBPF program types. -use std::{ffi::CStr, io, path::Path}; +use std::{ffi::CStr, io, os::fd::AsRawFd as _, path::Path}; use crate::{ programs::{FdLink, Link, ProgramData, ProgramError}, @@ -12,7 +12,7 @@ pub(crate) fn attach_raw_tracepoint>( tp_name: Option<&CStr>, ) -> Result { let prog_fd = program_data.fd_or_err()?; - + let prog_fd = prog_fd.as_raw_fd(); let pfd = bpf_raw_tracepoint_open(tp_name, prog_fd).map_err(|(_code, io_error)| SyscallError { call: "bpf_raw_tracepoint_open", diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index 35164e72f..97f81750c 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -8,7 +8,7 @@ use std::{ ffi::CString, hash::Hash, io, - os::fd::{AsFd as _, RawFd}, + os::fd::{AsFd as _, AsRawFd as _, RawFd}, }; use thiserror::Error; @@ -129,6 +129,7 @@ impl Xdp { flags: XdpFlags, ) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); let if_index = if_index as RawFd; if KernelVersion::current().unwrap() >= KernelVersion::new(5, 9, 0) { @@ -175,6 +176,7 @@ impl Xdp { /// Ownership of the link will transfer to this program. pub fn attach_to_link(&mut self, link: XdpLink) -> Result { let prog_fd = self.data.fd_or_err()?; + let prog_fd = prog_fd.as_raw_fd(); match link.into_inner() { XdpLinkInner::FdLink(fd_link) => { let link_fd = fd_link.fd; diff --git a/aya/src/sys/bpf.rs b/aya/src/sys/bpf.rs index 597edc767..7d2778d0c 100644 --- a/aya/src/sys/bpf.rs +++ b/aya/src/sys/bpf.rs @@ -132,7 +132,7 @@ pub(crate) fn bpf_load_program( aya_attr: &BpfLoadProgramAttrs, log_buf: &mut [u8], verifier_log_level: VerifierLogLevel, -) -> SysResult { +) -> SysResult { let mut attr = unsafe { mem::zeroed::() }; let u = unsafe { &mut attr.__bindgen_anon_3 }; @@ -190,7 +190,8 @@ pub(crate) fn bpf_load_program( if let Some(v) = aya_attr.attach_btf_id { u.attach_btf_id = v; } - sys_bpf(bpf_cmd::BPF_PROG_LOAD, &mut attr) + // SAFETY: BPF_PROG_LOAD returns a new file descriptor. + unsafe { fd_sys_bpf(bpf_cmd::BPF_PROG_LOAD, &mut attr) } } fn lookup( @@ -501,8 +502,7 @@ fn bpf_obj_get_info_by_fd(fd: BorrowedFd<'_>) -> Result { } } -pub(crate) fn bpf_prog_get_info_by_fd(fd: RawFd) -> Result { - let fd = unsafe { BorrowedFd::borrow_raw(fd) }; +pub(crate) fn bpf_prog_get_info_by_fd(fd: BorrowedFd<'_>) -> Result { bpf_obj_get_info_by_fd::(fd) } diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index db03ee59e..61e4eddcc 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -91,7 +91,7 @@ impl> aya::maps::ProgramArray pub fn aya::maps::ProgramArray::indices(&self) -> aya::maps::MapKeys<'_, u32> impl> aya::maps::ProgramArray pub fn aya::maps::ProgramArray::clear_index(&mut self, index: &u32) -> core::result::Result<(), aya::maps::MapError> -pub fn aya::maps::ProgramArray::set(&mut self, index: u32, program: aya::programs::ProgramFd, flags: u64) -> core::result::Result<(), aya::maps::MapError> +pub fn aya::maps::ProgramArray::set(&mut self, index: u32, program: aya::programs::ProgramFd<'_>, flags: u64) -> core::result::Result<(), aya::maps::MapError> impl core::convert::TryFrom for aya::maps::ProgramArray pub type aya::maps::ProgramArray::Error = aya::maps::MapError pub fn aya::maps::ProgramArray::try_from(map: aya::maps::Map) -> core::result::Result, aya::maps::MapError> @@ -1502,7 +1502,7 @@ impl> aya::maps::ProgramArray pub fn aya::maps::ProgramArray::indices(&self) -> aya::maps::MapKeys<'_, u32> impl> aya::maps::ProgramArray pub fn aya::maps::ProgramArray::clear_index(&mut self, index: &u32) -> core::result::Result<(), aya::maps::MapError> -pub fn aya::maps::ProgramArray::set(&mut self, index: u32, program: aya::programs::ProgramFd, flags: u64) -> core::result::Result<(), aya::maps::MapError> +pub fn aya::maps::ProgramArray::set(&mut self, index: u32, program: aya::programs::ProgramFd<'_>, flags: u64) -> core::result::Result<(), aya::maps::MapError> impl core::convert::TryFrom for aya::maps::ProgramArray pub type aya::maps::ProgramArray::Error = aya::maps::MapError pub fn aya::maps::ProgramArray::try_from(map: aya::maps::Map) -> core::result::Result, aya::maps::MapError> @@ -1804,7 +1804,7 @@ pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: ay pub fn aya::programs::cgroup_device::CgroupDevice::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::take_link(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice -pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::option::Option> impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice @@ -1947,7 +1947,7 @@ pub fn aya::programs::cgroup_skb::CgroupSkb::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb -pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::option::Option> impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_skb::CgroupSkb::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -2055,7 +2055,7 @@ pub fn aya::programs::cgroup_sock::CgroupSock::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::take_link(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result impl aya::programs::cgroup_sock::CgroupSock -pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sock::CgroupSock::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -2163,7 +2163,7 @@ pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::take_link(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result impl aya::programs::cgroup_sock_addr::CgroupSockAddr -pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -2271,7 +2271,7 @@ pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt -pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -2377,7 +2377,7 @@ pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: ay pub fn aya::programs::cgroup_sysctl::CgroupSysctl::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::take_link(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl -pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl @@ -2515,12 +2515,12 @@ pub fn aya::programs::extension::ExtensionError::from(t: T) -> T pub struct aya::programs::extension::Extension impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::attach(&mut self) -> core::result::Result -pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result +pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: aya::programs::ProgramFd<'_>, func_name: &str) -> core::result::Result pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> -pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> +pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd<'_>, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::take_link(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result impl aya::programs::extension::Extension -pub fn aya::programs::extension::Extension::fd(&self) -> core::option::Option +pub fn aya::programs::extension::Extension::fd(&self) -> core::option::Option> impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::from_pin>(path: P) -> core::result::Result impl aya::programs::extension::Extension @@ -2632,7 +2632,7 @@ pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs:: pub fn aya::programs::fentry::FEntry::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::take_link(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result impl aya::programs::fentry::FEntry -pub fn aya::programs::fentry::FEntry::fd(&self) -> core::option::Option +pub fn aya::programs::fentry::FEntry::fd(&self) -> core::option::Option> impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::from_pin>(path: P) -> core::result::Result impl aya::programs::fentry::FEntry @@ -2744,7 +2744,7 @@ pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fe pub fn aya::programs::fexit::FExit::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::take_link(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result impl aya::programs::fexit::FExit -pub fn aya::programs::fexit::FExit::fd(&self) -> core::option::Option +pub fn aya::programs::fexit::FExit::fd(&self) -> core::option::Option> impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::from_pin>(path: P) -> core::result::Result impl aya::programs::fexit::FExit @@ -2895,7 +2895,7 @@ pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result impl aya::programs::kprobe::KProbe -pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::option::Option +pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::option::Option> impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::kprobe::KProbe::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -3393,7 +3393,7 @@ pub fn aya::programs::lirc_mode2::LircMode2::load(&mut self) -> core::result::Re pub fn aya::programs::lirc_mode2::LircMode2::query(target_fd: T) -> core::result::Result, aya::programs::ProgramError> pub fn aya::programs::lirc_mode2::LircMode2::take_link(&mut self, link_id: aya::programs::lirc_mode2::LircLinkId) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 -pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::option::Option +pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::option::Option> impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::from_pin>(path: P) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 @@ -3440,7 +3440,7 @@ pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::L pub fn aya::programs::lsm::Lsm::load(&mut self, lsm_hook_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::take_link(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result impl aya::programs::lsm::Lsm -pub fn aya::programs::lsm::Lsm::fd(&self) -> core::option::Option +pub fn aya::programs::lsm::Lsm::fd(&self) -> core::option::Option> impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::from_pin>(path: P) -> core::result::Result impl aya::programs::lsm::Lsm @@ -3725,7 +3725,7 @@ pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::pro pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::take_link(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result impl aya::programs::perf_event::PerfEvent -pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::option::Option +pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::option::Option> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::from_pin>(path: P) -> core::result::Result impl aya::programs::perf_event::PerfEvent @@ -3919,7 +3919,7 @@ pub fn aya::programs::tc::SchedClassifier::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result impl aya::programs::tc::SchedClassifier -pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::option::Option +pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::option::Option> impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::tc::SchedClassifier::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -4057,7 +4057,7 @@ pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::pro pub fn aya::programs::tp_btf::BtfTracePoint::load(&mut self, tracepoint: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::take_link(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint -pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::option::Option +pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::option::Option> impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint @@ -4206,7 +4206,7 @@ pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::p pub fn aya::programs::trace_point::TracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::take_link(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result impl aya::programs::trace_point::TracePoint -pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::option::Option +pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::option::Option> impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::trace_point::TracePoint @@ -4366,7 +4366,7 @@ pub fn aya::programs::uprobe::UProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::uprobe::UProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result impl aya::programs::uprobe::UProbe -pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::option::Option +pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::option::Option> impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::uprobe::UProbe::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -4516,7 +4516,7 @@ pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::X pub fn aya::programs::xdp::Xdp::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result impl aya::programs::xdp::Xdp -pub fn aya::programs::xdp::Xdp::fd(&self) -> core::option::Option +pub fn aya::programs::xdp::Xdp::fd(&self) -> core::option::Option> impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::from_pin>(path: P) -> core::result::Result impl aya::programs::xdp::Xdp @@ -4976,7 +4976,7 @@ pub aya::programs::Program::TracePoint(aya::programs::trace_point::TracePoint) pub aya::programs::Program::UProbe(aya::programs::uprobe::UProbe) pub aya::programs::Program::Xdp(aya::programs::xdp::Xdp) impl aya::programs::Program -pub fn aya::programs::Program::fd(&self) -> core::option::Option +pub fn aya::programs::Program::fd(&self) -> core::option::Option> pub fn aya::programs::Program::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::Program::prog_type(&self) -> aya_obj::generated::linux_bindings_x86_64::bpf_prog_type pub fn aya::programs::Program::unload(self) -> core::result::Result<(), aya::programs::ProgramError> @@ -5527,7 +5527,7 @@ pub fn aya::programs::tp_btf::BtfTracePoint::detach(&mut self, link_id: aya::pro pub fn aya::programs::tp_btf::BtfTracePoint::load(&mut self, tracepoint: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tp_btf::BtfTracePoint::take_link(&mut self, link_id: aya::programs::tp_btf::BtfTracePointLinkId) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint -pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::option::Option +pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::option::Option> impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint @@ -5573,7 +5573,7 @@ pub fn aya::programs::cgroup_device::CgroupDevice::detach(&mut self, link_id: ay pub fn aya::programs::cgroup_device::CgroupDevice::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_device::CgroupDevice::take_link(&mut self, link_id: aya::programs::cgroup_device::CgroupDeviceLinkId) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice -pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::option::Option> impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice @@ -5621,7 +5621,7 @@ pub fn aya::programs::cgroup_skb::CgroupSkb::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya::programs::cgroup_skb::CgroupSkbLinkId) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb -pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::option::Option> impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_skb::CgroupSkb::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -5666,7 +5666,7 @@ pub fn aya::programs::cgroup_sock::CgroupSock::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock::CgroupSock::take_link(&mut self, link_id: aya::programs::cgroup_sock::CgroupSockLinkId) -> core::result::Result impl aya::programs::cgroup_sock::CgroupSock -pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sock::CgroupSock::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sock::CgroupSock pub fn aya::programs::cgroup_sock::CgroupSock::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sock::CgroupSock::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -5711,7 +5711,7 @@ pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::take_link(&mut self, link_id: aya::programs::cgroup_sock_addr::CgroupSockAddrLinkId) -> core::result::Result impl aya::programs::cgroup_sock_addr::CgroupSockAddr -pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sock_addr::CgroupSockAddr pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sock_addr::CgroupSockAddr::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -5756,7 +5756,7 @@ pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_id: aya::programs::cgroup_sockopt::CgroupSockoptLinkId) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt -pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::cgroup_sockopt::CgroupSockopt::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -5800,7 +5800,7 @@ pub fn aya::programs::cgroup_sysctl::CgroupSysctl::detach(&mut self, link_id: ay pub fn aya::programs::cgroup_sysctl::CgroupSysctl::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::cgroup_sysctl::CgroupSysctl::take_link(&mut self, link_id: aya::programs::cgroup_sysctl::CgroupSysctlLinkId) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl -pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::option::Option +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::option::Option> impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl @@ -5842,12 +5842,12 @@ pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from(t: T) -> T pub struct aya::programs::Extension impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::attach(&mut self) -> core::result::Result -pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result +pub fn aya::programs::extension::Extension::attach_to_program(&mut self, program: aya::programs::ProgramFd<'_>, func_name: &str) -> core::result::Result pub fn aya::programs::extension::Extension::detach(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result<(), aya::programs::ProgramError> -pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> +pub fn aya::programs::extension::Extension::load(&mut self, program: aya::programs::ProgramFd<'_>, func_name: &str) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::extension::Extension::take_link(&mut self, link_id: aya::programs::extension::ExtensionLinkId) -> core::result::Result impl aya::programs::extension::Extension -pub fn aya::programs::extension::Extension::fd(&self) -> core::option::Option +pub fn aya::programs::extension::Extension::fd(&self) -> core::option::Option> impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::from_pin>(path: P) -> core::result::Result impl aya::programs::extension::Extension @@ -5893,7 +5893,7 @@ pub fn aya::programs::fentry::FEntry::detach(&mut self, link_id: aya::programs:: pub fn aya::programs::fentry::FEntry::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fentry::FEntry::take_link(&mut self, link_id: aya::programs::fentry::FEntryLinkId) -> core::result::Result impl aya::programs::fentry::FEntry -pub fn aya::programs::fentry::FEntry::fd(&self) -> core::option::Option +pub fn aya::programs::fentry::FEntry::fd(&self) -> core::option::Option> impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::from_pin>(path: P) -> core::result::Result impl aya::programs::fentry::FEntry @@ -5939,7 +5939,7 @@ pub fn aya::programs::fexit::FExit::detach(&mut self, link_id: aya::programs::fe pub fn aya::programs::fexit::FExit::load(&mut self, fn_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::fexit::FExit::take_link(&mut self, link_id: aya::programs::fexit::FExitLinkId) -> core::result::Result impl aya::programs::fexit::FExit -pub fn aya::programs::fexit::FExit::fd(&self) -> core::option::Option +pub fn aya::programs::fexit::FExit::fd(&self) -> core::option::Option> impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::from_pin>(path: P) -> core::result::Result impl aya::programs::fexit::FExit @@ -5987,7 +5987,7 @@ pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result impl aya::programs::kprobe::KProbe -pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::option::Option +pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::option::Option> impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::kprobe::KProbe::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -6032,7 +6032,7 @@ pub fn aya::programs::lirc_mode2::LircMode2::load(&mut self) -> core::result::Re pub fn aya::programs::lirc_mode2::LircMode2::query(target_fd: T) -> core::result::Result, aya::programs::ProgramError> pub fn aya::programs::lirc_mode2::LircMode2::take_link(&mut self, link_id: aya::programs::lirc_mode2::LircLinkId) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 -pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::option::Option +pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::option::Option> impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::from_pin>(path: P) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 @@ -6078,7 +6078,7 @@ pub fn aya::programs::lsm::Lsm::detach(&mut self, link_id: aya::programs::lsm::L pub fn aya::programs::lsm::Lsm::load(&mut self, lsm_hook_name: &str, btf: &aya_obj::btf::btf::Btf) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::lsm::Lsm::take_link(&mut self, link_id: aya::programs::lsm::LsmLinkId) -> core::result::Result impl aya::programs::lsm::Lsm -pub fn aya::programs::lsm::Lsm::fd(&self) -> core::option::Option +pub fn aya::programs::lsm::Lsm::fd(&self) -> core::option::Option> impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::from_pin>(path: P) -> core::result::Result impl aya::programs::lsm::Lsm @@ -6124,7 +6124,7 @@ pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::pro pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::perf_event::PerfEvent::take_link(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result impl aya::programs::perf_event::PerfEvent -pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::option::Option +pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::option::Option> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::from_pin>(path: P) -> core::result::Result impl aya::programs::perf_event::PerfEvent @@ -6163,37 +6163,37 @@ impl core::borrow::BorrowMut for aya::programs::perf_event::PerfEvent wher pub fn aya::programs::perf_event::PerfEvent::borrow_mut(&mut self) -> &mut T impl core::convert::From for aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::from(t: T) -> T -pub struct aya::programs::ProgramFd(_) -impl std::os::fd::raw::AsRawFd for aya::programs::ProgramFd -pub fn aya::programs::ProgramFd::as_raw_fd(&self) -> std::os::fd::raw::RawFd -impl core::clone::Clone for aya::programs::ProgramFd -pub fn aya::programs::ProgramFd::clone(&self) -> aya::programs::ProgramFd -impl core::marker::Copy for aya::programs::ProgramFd -impl core::marker::Send for aya::programs::ProgramFd -impl core::marker::Sync for aya::programs::ProgramFd -impl core::marker::Unpin for aya::programs::ProgramFd -impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::ProgramFd -impl core::panic::unwind_safe::UnwindSafe for aya::programs::ProgramFd -impl core::convert::Into for aya::programs::ProgramFd where U: core::convert::From -pub fn aya::programs::ProgramFd::into(self) -> U -impl core::convert::TryFrom for aya::programs::ProgramFd where U: core::convert::Into -pub type aya::programs::ProgramFd::Error = core::convert::Infallible -pub fn aya::programs::ProgramFd::try_from(value: U) -> core::result::Result>::Error> -impl core::convert::TryInto for aya::programs::ProgramFd where U: core::convert::TryFrom -pub type aya::programs::ProgramFd::Error = >::Error -pub fn aya::programs::ProgramFd::try_into(self) -> core::result::Result>::Error> -impl alloc::borrow::ToOwned for aya::programs::ProgramFd where T: core::clone::Clone -pub type aya::programs::ProgramFd::Owned = T -pub fn aya::programs::ProgramFd::clone_into(&self, target: &mut T) -pub fn aya::programs::ProgramFd::to_owned(&self) -> T -impl core::any::Any for aya::programs::ProgramFd where T: 'static + core::marker::Sized -pub fn aya::programs::ProgramFd::type_id(&self) -> core::any::TypeId -impl core::borrow::Borrow for aya::programs::ProgramFd where T: core::marker::Sized -pub fn aya::programs::ProgramFd::borrow(&self) -> &T -impl core::borrow::BorrowMut for aya::programs::ProgramFd where T: core::marker::Sized -pub fn aya::programs::ProgramFd::borrow_mut(&mut self) -> &mut T -impl core::convert::From for aya::programs::ProgramFd -pub fn aya::programs::ProgramFd::from(t: T) -> T +pub struct aya::programs::ProgramFd<'program>(_) +impl std::os::fd::owned::AsFd for aya::programs::ProgramFd<'_> +pub fn aya::programs::ProgramFd<'_>::as_fd(&self) -> std::os::fd::owned::BorrowedFd<'_> +impl<'program> core::clone::Clone for aya::programs::ProgramFd<'program> +pub fn aya::programs::ProgramFd<'program>::clone(&self) -> aya::programs::ProgramFd<'program> +impl<'program> core::marker::Copy for aya::programs::ProgramFd<'program> +impl<'program> core::marker::Send for aya::programs::ProgramFd<'program> +impl<'program> core::marker::Sync for aya::programs::ProgramFd<'program> +impl<'program> core::marker::Unpin for aya::programs::ProgramFd<'program> +impl<'program> core::panic::unwind_safe::RefUnwindSafe for aya::programs::ProgramFd<'program> +impl<'program> core::panic::unwind_safe::UnwindSafe for aya::programs::ProgramFd<'program> +impl core::convert::Into for aya::programs::ProgramFd<'program> where U: core::convert::From +pub fn aya::programs::ProgramFd<'program>::into(self) -> U +impl core::convert::TryFrom for aya::programs::ProgramFd<'program> where U: core::convert::Into +pub type aya::programs::ProgramFd<'program>::Error = core::convert::Infallible +pub fn aya::programs::ProgramFd<'program>::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::ProgramFd<'program> where U: core::convert::TryFrom +pub type aya::programs::ProgramFd<'program>::Error = >::Error +pub fn aya::programs::ProgramFd<'program>::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::ProgramFd<'program> where T: core::clone::Clone +pub type aya::programs::ProgramFd<'program>::Owned = T +pub fn aya::programs::ProgramFd<'program>::clone_into(&self, target: &mut T) +pub fn aya::programs::ProgramFd<'program>::to_owned(&self) -> T +impl core::any::Any for aya::programs::ProgramFd<'program> where T: 'static + core::marker::Sized +pub fn aya::programs::ProgramFd<'program>::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::ProgramFd<'program> where T: core::marker::Sized +pub fn aya::programs::ProgramFd<'program>::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::ProgramFd<'program> where T: core::marker::Sized +pub fn aya::programs::ProgramFd<'program>::borrow_mut(&mut self) -> &mut T +impl core::convert::From for aya::programs::ProgramFd<'program> +pub fn aya::programs::ProgramFd<'program>::from(t: T) -> T pub struct aya::programs::ProgramInfo(_) impl aya::programs::ProgramInfo pub fn aya::programs::ProgramInfo::fd(&self) -> core::result::Result @@ -6231,7 +6231,7 @@ pub fn aya::programs::RawTracePoint::detach(&mut self, link_id: RawTracePointLin pub fn aya::programs::RawTracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::RawTracePoint::take_link(&mut self, link_id: RawTracePointLinkId) -> core::result::Result impl aya::programs::RawTracePoint -pub fn aya::programs::RawTracePoint::fd(&self) -> core::option::Option +pub fn aya::programs::RawTracePoint::fd(&self) -> core::option::Option> impl aya::programs::RawTracePoint pub fn aya::programs::RawTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::RawTracePoint @@ -6279,7 +6279,7 @@ pub fn aya::programs::tc::SchedClassifier::from_pin core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::programs::tc::SchedClassifierLinkId) -> core::result::Result impl aya::programs::tc::SchedClassifier -pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::option::Option +pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::option::Option> impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::tc::SchedClassifier::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -6323,7 +6323,7 @@ pub fn aya::programs::SkLookup::detach(&mut self, link_id: SkLookupLinkId) -> co pub fn aya::programs::SkLookup::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::SkLookup::take_link(&mut self, link_id: SkLookupLinkId) -> core::result::Result impl aya::programs::SkLookup -pub fn aya::programs::SkLookup::fd(&self) -> core::option::Option +pub fn aya::programs::SkLookup::fd(&self) -> core::option::Option> impl aya::programs::SkLookup pub fn aya::programs::SkLookup::from_pin>(path: P) -> core::result::Result impl aya::programs::SkLookup @@ -6369,7 +6369,7 @@ pub fn aya::programs::SkMsg::detach(&mut self, link_id: SkMsgLinkId) -> core::re pub fn aya::programs::SkMsg::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::SkMsg::take_link(&mut self, link_id: SkMsgLinkId) -> core::result::Result impl aya::programs::SkMsg -pub fn aya::programs::SkMsg::fd(&self) -> core::option::Option +pub fn aya::programs::SkMsg::fd(&self) -> core::option::Option> impl aya::programs::SkMsg pub fn aya::programs::SkMsg::from_pin>(path: P) -> core::result::Result impl aya::programs::SkMsg @@ -6416,7 +6416,7 @@ pub fn aya::programs::SkSkb::from_pin>( pub fn aya::programs::SkSkb::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::SkSkb::take_link(&mut self, link_id: SkSkbLinkId) -> core::result::Result impl aya::programs::SkSkb -pub fn aya::programs::SkSkb::fd(&self) -> core::option::Option +pub fn aya::programs::SkSkb::fd(&self) -> core::option::Option> impl aya::programs::SkSkb pub fn aya::programs::SkSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::SkSkb::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -6460,7 +6460,7 @@ pub fn aya::programs::SockOps::detach(&mut self, link_id: SockOpsLinkId) -> core pub fn aya::programs::SockOps::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::SockOps::take_link(&mut self, link_id: SockOpsLinkId) -> core::result::Result impl aya::programs::SockOps -pub fn aya::programs::SockOps::fd(&self) -> core::option::Option +pub fn aya::programs::SockOps::fd(&self) -> core::option::Option> impl aya::programs::SockOps pub fn aya::programs::SockOps::from_pin>(path: P) -> core::result::Result impl aya::programs::SockOps @@ -6506,7 +6506,7 @@ pub fn aya::programs::SocketFilter::detach(&mut self, link_id: SocketFilterLinkI pub fn aya::programs::SocketFilter::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::SocketFilter::take_link(&mut self, link_id: SocketFilterLinkId) -> core::result::Result impl aya::programs::SocketFilter -pub fn aya::programs::SocketFilter::fd(&self) -> core::option::Option +pub fn aya::programs::SocketFilter::fd(&self) -> core::option::Option> impl aya::programs::SocketFilter pub fn aya::programs::SocketFilter::from_pin>(path: P) -> core::result::Result impl aya::programs::SocketFilter @@ -6552,7 +6552,7 @@ pub fn aya::programs::trace_point::TracePoint::detach(&mut self, link_id: aya::p pub fn aya::programs::trace_point::TracePoint::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::trace_point::TracePoint::take_link(&mut self, link_id: aya::programs::trace_point::TracePointLinkId) -> core::result::Result impl aya::programs::trace_point::TracePoint -pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::option::Option +pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::option::Option> impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::trace_point::TracePoint @@ -6600,7 +6600,7 @@ pub fn aya::programs::uprobe::UProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::uprobe::UProbe::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::programs::uprobe::UProbeLinkId) -> core::result::Result impl aya::programs::uprobe::UProbe -pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::option::Option +pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::option::Option> impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> pub fn aya::programs::uprobe::UProbe::unpin(self) -> core::result::Result<(), std::io::error::Error> @@ -6646,7 +6646,7 @@ pub fn aya::programs::xdp::Xdp::detach(&mut self, link_id: aya::programs::xdp::X pub fn aya::programs::xdp::Xdp::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp::XdpLinkId) -> core::result::Result impl aya::programs::xdp::Xdp -pub fn aya::programs::xdp::Xdp::fd(&self) -> core::option::Option +pub fn aya::programs::xdp::Xdp::fd(&self) -> core::option::Option> impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::from_pin>(path: P) -> core::result::Result impl aya::programs::xdp::Xdp