> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Wednesday, 15 November 2023 01.18 > > On Tue, 14 Nov 2023 16:24:58 +0800 > Dengdui Huang <huangdeng...@huawei.com> wrote: > > > The function strerror() is insecure in a multi-thread environment. > > This patch uses rte_strerror() to replace it. > > > > Cc: sta...@dpdk.org > > > > Signed-off-by: Dengdui Huang <huangdeng...@huawei.com> > > Acked-by: Chengwen Feng <fengcheng...@huawei.com> > > NAK. > rte_strerror() is no more thrad safe than strerror()
It is thread safe: https://elixir.bootlin.com/dpdk/v23.11-rc3/source/lib/eal/common/eal_common_errno.c#L31 > and only > is appropriate for rte_errno, ie errors from DPDK. > It is not originally designed as strerror() replacement. I can buy this argument. However, if we ensure that DPDK specific error numbers don't overlap POSIX (and Windows specific, if any) error numbers, I would consider rte_strerror() an excellent alternative to strerror(). We could then consider deeming strerror() unsafe, and add it to checkpatches to recommend rte_strerror() as the general replacement.