NPTL auto detection

Dag Wieers dag at
Fri May 16 23:22:15 CDT 2003


I'm not subscribed to this list but noticed the NPTL discussion on Wine 
Traffic #170. I saw a lot of people mentioning to make it a compile-time 
option, but no one with a definitive runtime check.

Valgrind went through the same problem and I proposed a solution on their 
list. AFAIK they're not using it, they still have a run-time parameter 
instead of auto-detecting it on loadtime.

The discussion is here:

And a couple of lines to check what threading library is used:

	//#define _XOPEN_SOURCE
	#define _POSIX_C_SOURCE 2
	#include <unistd.h>
	#include <stdio.h>

	int main(void) {
	        char *buf; size_t n;

	        n=confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, (size_t) 0);
	        if ((buf = (char *) malloc(n)) == NULL) abort();
	        confstr(_CS_GNU_LIBPTHREAD_VERSION, buf, n);
	        fprintf(stdout, "%s\n", buf); exit(0);

Which is basicly the same as:


I'm not sure if this is new information, but I didn't see it mentioned 

Kind regards,
--   dag wieers,  dag at,   --
«Any errors in spelling, tact or fact are transmission errors»

More information about the wine-devel mailing list