NPTL auto detection

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


Hi,

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:

	http://sourceforge.net/mailarchive/forum.php?thread_id=2027895&forum_id=32038
	http://sourceforge.net/mailarchive/forum.php?thread_id=2052985&forum_id=32038

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:

	getconf GNU_LIBPTHREAD_VERSION

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

Kind regards,
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
«Any errors in spelling, tact or fact are transmission errors»




More information about the wine-devel mailing list