libbpf-rs icon indicating copy to clipboard operation
libbpf-rs copied to clipboard

Support returning errors from query API

Open danobi opened this issue 5 years ago • 1 comments

The query API is iterator based. Each iteration is technically fallible but there's no great way to report errors.

I played around with making the iterator type by Result<T> but that can cause infinite loops: 24aa7ea561e06dd2a .

Not sure what can be done about it. Maybe https://docs.rs/fallible-iterator/0.2.0/fallible_iterator/ but that library isn't very nice b/c it reimplements much of the iterator standard library helpers.

danobi avatar Jul 14 '20 21:07 danobi

How do your proposed changes cause an infinite loop? Shouldn't we stop when bpf_obj_get_next_id returns a non-zero value?

kckeiks avatar Mar 08 '22 00:03 kckeiks