On Wed, Jul 16, 2025 at 07:43:39PM +0600, unadvised wrote:
> +#  if defined(__NetBSD__)
> +  const int result = pthread_setname_np(pthread_self(), name_.c_str(),
> (void*)strlen(name_.c_str())); +#  else
>    const int result = pthread_setname_np(pthread_self(), name_.c_str());
> +#  endif

That is wrong. Make it:

    const int result = pthread_setname_np(pthread_self(), "%s", name_.c_str())

Do not confuse "arg" with the "len" argument from pthread_getname_np().

Martin

Reply via email to