On Mon, Jun 29, 2026 at 03:29:20PM +0100, Bruce Richardson wrote:
> Glibc added the strlcpy and strlcat functions to version 2.38, released
> in 2023, meaning they are natively available in modern linux distros. At
> this point, the value of having the libbsd provided versions of these
> functions is reduced, so let's simplify the code options here by
> providing just two options for strlcpy rather than three:
>
> 1. native implementation for BSD and recent Linux
> 2. DPDK-specific fallbacks using snprintf
>
> Since the strlcpy and strlcat functions are the only two items used from
> libbsd, we can then drop completely any DPDK dependency on libbsd.
>
> Signed-off-by: Bruce Richardson <[email protected]>
> ---
> v3:
> * removed additional references to libbsd in scripts and docs
> * corrected detection of strlcpy by adding _GNU_SOURCE to detection
> check, which matches DPDK build.
> * added extra macro check in fallback header, to handle case where
> strlcpy is available for DPDK build, but not for app builds, e.g.
> where strict c11 compliance is required.
>
> v2:
> * Took the work further than v1, dropping libbsd dependency entirely.
> Now DPDK just supports native strlcpy or it's own fallback version.
> ---
> .github/workflows/build.yml | 2 --
> app/test/test_string_fns.c | 4 ++--
> buildtools/pkg-config/meson.build | 3 +--
> config/meson.build | 7 +++----
> devtools/process-iwyu.py | 10 +++++-----
> doc/guides/howto/af_xdp_dp.rst | 1 -
> lib/eal/include/rte_string_fns.h | 22 ++++++----------------
> lib/eal/meson.build | 4 +---
> lib/telemetry/telemetry.c | 2 --
> lib/telemetry/telemetry_data.c | 1 -
> lib/telemetry/telemetry_legacy.c | 2 --
> 11 files changed, 18 insertions(+), 40 deletions(-)
>
Ping for review or comments on this change!