varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

build: Keep an autoconf check for pthread_setname_np()

Open dridi opened this issue 1 year ago • 3 comments

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

dridi avatar May 07 '24 08:05 dridi

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.

bsdphk avatar May 13 '24 13:05 bsdphk

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);
  ^

nigoroll avatar Jun 04 '24 08:06 nigoroll

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().

dridi avatar Jun 04 '24 09:06 dridi

FYI: Just hit this on OpenBSD.

catap avatar Nov 07 '24 15:11 catap

bugwash: @walid-git to resolve conflicts and merge

nigoroll avatar Nov 25 '24 14:11 nigoroll

Merged as https://github.com/varnishcache/varnish-cache/compare/e3aa6133952b898c07098c918585778ee4b4365e...772d7385dbe2cfa8b70d98af0b5da1236727e58b. Closing this PR.

walid-git avatar Dec 23 '24 10:12 walid-git