numam-dpdk/devtools
Bruce Richardson 5364de644a eal: support strlcpy function
The strncpy function is error prone for doing "safe" string copies, so
we generally try to use "snprintf" instead in the code. The function
"strlcpy" is a better alternative, since it better conveys the
intention of the programmer, and doesn't suffer from the non-null
terminating behaviour of it's n'ed brethern.

The downside of this function is that it is not available by default
on linux, though standard in the BSD's. It is available on most
distros by installing "libbsd" package.

This patch therefore provides the following in rte_string_fns.h to ensure
that strlcpy is available there:
* for BSD, include string.h as normal
* if RTE_USE_LIBBSD is set, include <bsd/string.h>
* if not set, fallback to snprintf for strlcpy

Using make build system, the RTE_USE_LIBBSD is a hard-coded value to "n",
but when using meson, it's automatically set based on what is available
on the platform.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
2018-04-04 17:33:08 +02:00
..
cocci eal: support strlcpy function 2018-04-04 17:33:08 +02:00
build-tags.sh
check-dup-includes.sh
check-git-log.sh
check-includes.sh
check-maintainers.sh
checkpatches.sh
cocci.sh
get-maintainer.sh devtools: do not create kernel dir 2018-04-04 13:43:33 +02:00
git-log-fixes.sh
load-devel-config
test-build.sh bb/turbo_sw: add software turbo driver 2018-01-19 01:44:25 +01:00
test-null.sh
validate-abi.sh compat: relicense some files 2018-02-06 23:13:47 +01:00