Skip to content

Commit cb9426a

Browse files
calebhodanielocfb
authored andcommitted
allow ring__ functions
1 parent f62bb01 commit cb9426a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ fn generate_bindings(src_dir: path::PathBuf) {
7171
.allowlist_function("btf_.+")
7272
.allowlist_function("libbpf_.+")
7373
.allowlist_function("perf_.+")
74+
.allowlist_function("ring__.+")
7475
.allowlist_function("ring_buffer_.+")
7576
.allowlist_function("user_ring_buffer_.+")
7677
.allowlist_function("vdprintf")

src/bindings.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8760,6 +8760,27 @@ unsafe extern "C" {
87608760
unsafe extern "C" {
87618761
pub fn ring_buffer__ring(rb: *mut ring_buffer, idx: ::std::os::raw::c_uint) -> *mut ring;
87628762
}
8763+
unsafe extern "C" {
8764+
pub fn ring__consumer_pos(r: *const ring) -> ::std::os::raw::c_ulong;
8765+
}
8766+
unsafe extern "C" {
8767+
pub fn ring__producer_pos(r: *const ring) -> ::std::os::raw::c_ulong;
8768+
}
8769+
unsafe extern "C" {
8770+
pub fn ring__avail_data_size(r: *const ring) -> size_t;
8771+
}
8772+
unsafe extern "C" {
8773+
pub fn ring__size(r: *const ring) -> size_t;
8774+
}
8775+
unsafe extern "C" {
8776+
pub fn ring__map_fd(r: *const ring) -> ::std::os::raw::c_int;
8777+
}
8778+
unsafe extern "C" {
8779+
pub fn ring__consume(r: *mut ring) -> ::std::os::raw::c_int;
8780+
}
8781+
unsafe extern "C" {
8782+
pub fn ring__consume_n(r: *mut ring, n: size_t) -> ::std::os::raw::c_int;
8783+
}
87638784
#[repr(C)]
87648785
#[derive(Debug, Default, Copy, Clone)]
87658786
pub struct user_ring_buffer_opts {

0 commit comments

Comments
 (0)