What's the difference between GNU_LIBC_VERSION and GNU_NPTL_VERSION?

Please note the following two configuration options for RedHat Linux system:

$ getconf GNU_LIBC_VERSION
glibc 2.3.4

$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.3.4

      

I see that they correspond to some of the TLS libraries:

/lib/tls/libc-2.3.4.so
/lib/tls/libm-2.3.4.so
/lib/tls/libpthread-2.3.4.so
/lib/tls/librt-2.3.4.so

      

I would like to link these libraries instead of equivalents /usr/lib

. I have several questions:

  • I've seen this on RedHat and Debian. Does it exist in all GNU Linux distributions?
  • Is there a case where it GNU_LIBC_VERSION

    differs from GNU_LIBPTHREAD_VERSION

    ?
  • Are these variables safe to identify shared libraries in /lib/tls

    ? I would like to automate this in the Makefile, not hardcode the magic version number of glibc / pthread.
+1


source to share


1 answer


The NPTL project that first implemented pThreads on Linux was a separate project that originally added kernel support and provided its own library.

When it was stable enough, it was merged with glibc. I would assume the two versions are identical across all reasonably modern installations.



In Ubuntu 8.10, the output looks like this:

$ getconf GNU_LIBC_VERSION
glibc 2.8.90
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.8.90
+3


source







All Articles