varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.56k stars 365 forks source link

build: Keep an autoconf check for pthread_setname_np() #4103

Open dridi opened 1 month ago

dridi commented 1 month ago

It is not portable by definition, so we should keep the guards.

bsdphk commented 1 month ago

First apologies for confusing everybody with a sign-error on the underscore

There is no reason to retain this check because all relevant platforms today have pthread_setname_np() and if somebody wants to port varnish to a new platform, they will have to provide a pthread_setname_np() function.

Please also note that the "_np" suffix literally means "POSIX is stuck in the 1990'ies where some people ran VMS", it doesnt mean that all contemporary platforms do not have it.

nigoroll commented 1 month ago

FTR, I just hit this on a not-so-recent SmartOS

cache/cache_main.c: In function 'THR_SetName':
cache/cache_main.c:142:2: error: implicit declaration of function 'pthread_setname_np' [-Werror=implicit-function-declaration]
  (void)pthread_setname_np(pthread_self(), name);
  ^
dridi commented 1 month ago

The THR_SetName() function still serves the purpose of stashing the thread name that is displayed in a panic in the absence of pthread_setname_np().