@@ -72,7 +72,7 @@ use std::{
72
72
ffi:: CString ,
73
73
io,
74
74
num:: NonZeroU32 ,
75
- os:: fd:: { AsFd , AsRawFd , BorrowedFd , OwnedFd } ,
75
+ os:: fd:: { AsFd , AsRawFd , BorrowedFd } ,
76
76
path:: { Path , PathBuf } ,
77
77
sync:: Arc ,
78
78
time:: { Duration , SystemTime } ,
@@ -224,7 +224,7 @@ pub enum ProgramError {
224
224
225
225
/// A [`Program`] file descriptor.
226
226
#[ derive( Debug ) ]
227
- pub struct ProgramFd ( OwnedFd ) ;
227
+ pub struct ProgramFd ( crate :: MockableFd ) ;
228
228
229
229
impl ProgramFd {
230
230
/// Creates a new instance that shares the same underlying file description as [`self`].
@@ -460,10 +460,10 @@ pub(crate) struct ProgramData<T: Link> {
460
460
pub ( crate ) fd : Option < ProgramFd > ,
461
461
pub ( crate ) links : LinkMap < T > ,
462
462
pub ( crate ) expected_attach_type : Option < bpf_attach_type > ,
463
- pub ( crate ) attach_btf_obj_fd : Option < OwnedFd > ,
463
+ pub ( crate ) attach_btf_obj_fd : Option < crate :: MockableFd > ,
464
464
pub ( crate ) attach_btf_id : Option < u32 > ,
465
465
pub ( crate ) attach_prog_fd : Option < ProgramFd > ,
466
- pub ( crate ) btf_fd : Option < Arc < OwnedFd > > ,
466
+ pub ( crate ) btf_fd : Option < Arc < crate :: MockableFd > > ,
467
467
pub ( crate ) verifier_log_level : VerifierLogLevel ,
468
468
pub ( crate ) path : Option < PathBuf > ,
469
469
pub ( crate ) flags : u32 ,
@@ -473,7 +473,7 @@ impl<T: Link> ProgramData<T> {
473
473
pub ( crate ) fn new (
474
474
name : Option < String > ,
475
475
obj : ( obj:: Program , obj:: Function ) ,
476
- btf_fd : Option < Arc < OwnedFd > > ,
476
+ btf_fd : Option < Arc < crate :: MockableFd > > ,
477
477
verifier_log_level : VerifierLogLevel ,
478
478
) -> Self {
479
479
Self {
@@ -494,7 +494,7 @@ impl<T: Link> ProgramData<T> {
494
494
495
495
pub ( crate ) fn from_bpf_prog_info (
496
496
name : Option < String > ,
497
- fd : OwnedFd ,
497
+ fd : crate :: MockableFd ,
498
498
path : & Path ,
499
499
info : bpf_prog_info ,
500
500
verifier_log_level : VerifierLogLevel ,
0 commit comments