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 tools: use SPDX tag for Cavium copyright files 2018-01-09 16:19:01 +01:00
check-dup-includes.sh devtools: add script to find duplicated includes 2017-08-03 12:05:09 +02:00
check-git-log.sh devtools: add git log checks for SCTP and IOVA 2018-01-04 18:33:34 +01:00
check-includes.sh devtools: update check-includes exceptions 2018-01-17 00:24:45 +01:00
check-maintainers.sh devtools: speed up maintainers check 2017-08-03 12:40:35 +02:00
checkpatches.sh devtools: ignore checkpatch warning for maintainers file 2018-01-09 01:43:25 +01:00
cocci.sh scripts: move to devtools 2017-01-04 21:17:32 +01:00
get-maintainer.sh devtools: do not create kernel dir 2018-04-04 13:43:33 +02:00
git-log-fixes.sh devtools: fix version search with git < 2.7.0 2017-09-22 15:42:24 +02:00
load-devel-config scripts: move to devtools 2017-01-04 21:17:32 +01:00
test-build.sh bb/turbo_sw: add software turbo driver 2018-01-19 01:44:25 +01:00
test-null.sh scripts: move to devtools 2017-01-04 21:17:32 +01:00
validate-abi.sh compat: relicense some files 2018-02-06 23:13:47 +01:00