Open dridi opened 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.
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);
^
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()
.
It is not portable by definition, so we should keep the guards.