Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libbpf-rs/src/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ impl<'a> RingBuffer<'a> {

util::parse_ret(ret)
}

/// Get an fd that can be used to sleep until data is available
pub fn epoll_fd(&self) -> i32 {
assert!(!self.ptr.is_null());

unsafe { libbpf_sys::ring_buffer__epoll_fd(self.ptr) }
}
}

impl<'a> Drop for RingBuffer<'a> {
Expand Down