I hav a programme, which must work differently for linuxthreads and nptl.
Are there defines in this libs, that can be used in my programme to detect, is nptl is used or is linuxthreads is?
UPDATE1: For runtime there is a getconf GLIBC_LIBPTHREADS, but what for compile-time?
Doesn't look like this is possible, you can change the implementation at load time so there's no way to know at compile time no matter what you do.
from the pthreads man page:
Not to mention that the two implementations are (mostly) binary compatible, so basically you CANNOT know at compile time which thread library will be used, EVER, because it might change depending on the environment variables present when your program is run, or someone could copy the binary from an NPTL system to a LinuxThreads system. You just can't do it, because it's not something that is known at compile time, at least not in a way you can rely on.
You'll have to find some way to use run time detection, or maybe you could update your post with information about WHY you want to do this and someone could maybe offer advice about how to accomplish it some other way, or how to make it possible to use run time detection of which pthreads is in use.
The other possible solution is to add an option to your configure script and make the person compiling it choose.