(...)
> Given that we won't have the proper knowledge of these fields from the
> libc itself which is not always in sync with the kernel (especially since
> people run whatever OS in containers on a different kernel), I tend to think
> that in order to maximize the portability we should simply define our own
> structure with our own fields, and possibly adjust it a bit depending on
> the operating system (eg: linux vs freebsd).
> 
> What do you think ? If you want, as a first step we can merge your patch
> as-is with surrounding #ifdef __linux__ and drop the two parts that are
> not compatible with 2.4. Probably that we'll have to think about dropping
> support for linux < 2.6.something for version 1.8.

And FWIW we're not the only ones to suffer :

   https://github.com/esnet/iperf/blob/master/src/tcp_info.c

That tends to confirm my thinking that embedding our own version of
tcp_info for both linux and freebsd could be the right thing to do
(at least when we don't know well enough).

Willy


Reply via email to