Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3338534
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:23:15+00:00 2026-05-18T00:23:15+00:00

I hav a programme, which must work differently for linuxthreads and nptl. Are there

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:23:16+00:00Added an answer on May 18, 2026 at 12:23 am

    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:

    On systems with a glibc that supports
    both LinuxThreads and NPTL (i.e.,
    glibc 2.3.x), the LD_ASSUME_KERNEL
    environment variable can be used to
    override the dynamic linker’s default
    choice of threading implementation.
    This variable tells the dynamic linker
    to assume that it is running on top of
    a particular kernel version. By
    specifying a kernel version that does
    not provide the support required by
    NPTL, we can force the use of
    LinuxThreads. (The most likely reason
    for doing this is to run a (broken)
    application that depends on some
    nonconformant behavior in
    LinuxThreads.) For example:

    bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \
                    awk '{print $3}' ) | egrep -i 'threads|ntpl'
    linuxthreads-0.10 by Xavier Leroy
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i hav a tabular forms used to generate reports which are html files and
i hav an html file which displays table view ,how to load this on
I hav codes eg1.py , eg2.py , eg3.py eg3.py imports eg2.py which in turn
i hav created a COM component using vs2005 . Now let me know can
hi i hav a code like this in the end i m getting error
im a newbie to flash,and i hav got this really weird problem.i have created
I hav a string e.g. 2010-09-24 . Now I want this string read as
i hav a file with some data and i want to attach this file
I have the following code that is used to switch background images on different
I'im writing a program that works with 2 forms, the main form and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.