*/
LIBBPF_API size_t ring__size(const struct ring *r);
+/**
+ * @brief **ring__map_fd()** returns the file descriptor underlying the given
+ * ringbuffer.
+ *
+ * @param r A ringbuffer object.
+ * @return The underlying ringbuffer file descriptor
+ */
+LIBBPF_API int ring__map_fd(const struct ring *r);
+
struct user_ring_buffer_opts {
size_t sz; /* size of this struct, for forward/backward compatibility */
};
bpf_program__attach_uprobe_multi;
ring__avail_data_size;
ring__consumer_pos;
+ ring__map_fd;
ring__producer_pos;
ring__size;
ring_buffer__ring;
return r->mask + 1;
}
+int ring__map_fd(const struct ring *r)
+{
+ return r->map_fd;
+}
+
static void user_ringbuf_unmap_ring(struct user_ring_buffer *rb)
{
if (rb->consumer_pos) {