Re: [PATCH bpf] libbpf: reset errno after probing kernel features

2020-11-30 Thread Andrii Nakryiko
On Mon, Nov 30, 2020 at 2:41 PM Toke Høiland-Jørgensen wrote: > > Andrii Nakryiko writes: > > > On Mon, Nov 30, 2020 at 7:42 AM Toke Høiland-Jørgensen > > wrote: > >> > >> The kernel feature probing results in 'errno' being set if the probing > >> fails (as is often the case). This can stick ar

Re: [PATCH bpf] libbpf: reset errno after probing kernel features

2020-11-30 Thread Toke Høiland-Jørgensen
Andrii Nakryiko writes: > On Mon, Nov 30, 2020 at 7:42 AM Toke Høiland-Jørgensen > wrote: >> >> The kernel feature probing results in 'errno' being set if the probing >> fails (as is often the case). This can stick around and leak to the caller, >> which can lead to confusion later. So let's ma

Re: [PATCH bpf] libbpf: reset errno after probing kernel features

2020-11-30 Thread Andrii Nakryiko
On Mon, Nov 30, 2020 at 7:42 AM Toke Høiland-Jørgensen wrote: > > The kernel feature probing results in 'errno' being set if the probing > fails (as is often the case). This can stick around and leak to the caller, > which can lead to confusion later. So let's make sure we always reset errno > aft

[PATCH bpf] libbpf: reset errno after probing kernel features

2020-11-30 Thread Toke Høiland-Jørgensen
The kernel feature probing results in 'errno' being set if the probing fails (as is often the case). This can stick around and leak to the caller, which can lead to confusion later. So let's make sure we always reset errno after calling a probe function. Fixes: 47b6cb4d0add ("libbpf: Make kernel f