Question: `libbpf_err` vs `libbpf_err_errno`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using libbpf and want to make sure I'm properly handling errors.

I see that some functions (such as `bpf_map_batch_common`) return
error codes using `libbpf_err_errno()`. My understanding is that since
libbpf_err_errno() returns -errno, these function calls can just be
followed by checking the returned error code.

Some functions (such as `bpf_map__pin`) return `libbpf_err(int ret)`
which sets errno and returns the error code. In this case, does errno
even need to be checked?

Why the inconsistency? I'd like to document this, so anything else
that you can add on error handling in libbpf is welcome. That includes
example usage.

Thanks!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux