From: Kurt Miller Subject: Re: Truncate long thread names in setthrname(2) To: tech@openbsd.org Cc: Kurt Miller Date: Mon, 24 Nov 2025 00:41:05 +0000 On Nov 23, 2025, at 7:06 PM, Kurt Miller wrote: > > Instead of failing with EINVAL when setthrname(2) is passed a thread > name longer then MAXCOMLEN, truncate the name to fit. This is likely > what the user wants and saves them from having to snprintf(3) into a > buffer sized MAXCOMLEN+1 first. > > This makes pthread_set_name_np(3) succeed with long thread names > instead of silently failing. Forgot to mention: and also matches what FreeBSD does.