Skip to content

Commit 3dbc8a7

Browse files
committed
ringbuf: Fix callback docs
It's not non-zero - it's negative error values. The error is also propagated (which is important if translated to Result), so document that as well. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
1 parent e73ade6 commit 3dbc8a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libbpf-rs/src/ringbuf.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ impl<'slf, 'cb: 'slf> RingBufferBuilder<'slf, 'cb> {
6767
/// manager. The callback should take one argument, a slice of raw bytes,
6868
/// and return an i32.
6969
///
70-
/// Non-zero return values in the callback will stop ring buffer consumption early.
70+
/// Negative return values in the callback will stop ring buffer consumption early and
71+
/// propagate the error code to the polling caller.
7172
///
7273
/// The callback provides a raw byte slice. You may find libraries such as
7374
/// [`plain`](https://crates.io/crates/plain) helpful.

0 commit comments

Comments
 (0)