{
    "mode": "man",
    "parameter": "nptl",
    "section": "7",
    "url": "https://www.chedong.com/phpMan.php/man/nptl/7/json",
    "generated": "2026-06-10T02:39:09Z",
    "sections": {
        "NAME": {
            "content": "nptl - Native POSIX Threads Library\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "NPTL (Native POSIX Threads Library) is the GNU C library POSIX threads implementation that is\nused on modern Linux systems.\n",
            "subsections": [
                {
                    "name": "NPTL and signals",
                    "content": "NPTL makes internal use of the first two real-time signals (signal numbers 32 and  33).   One\nof  these  signals  is  used  to support thread cancellation and POSIX timers (see timercre‐‐\nate(2)); the other is used as part of a mechanism that ensures all threads in a  process  al‐\nways  have the same UIDs and GIDs, as required by POSIX.  These signals cannot be used in ap‐\nplications.\n\nTo prevent accidental use of these signals in applications, which might  interfere  with  the\noperation of the NPTL implementation, various glibc library functions and system call wrapper\nfunctions attempt to hide these signals from applications, as follows:\n\n*  SIGRTMIN is defined with the value 34 (rather than 32).\n\n*  The sigwaitinfo(2), sigtimedwait(2), and sigwait(3) interfaces silently ignore requests to\nwait  for  these  two  signals  if  they are specified in the signal set argument of these\ncalls.\n\n*  The sigprocmask(2) and pthreadsigmask(3) interfaces silently  ignore  attempts  to  block\nthese two signals.\n\n*  The  sigaction(2), pthreadkill(3), and pthreadsigqueue(3) interfaces fail with the error\nEINVAL (indicating an invalid signal number) if these signals are specified.\n\n*  sigfillset(3) does not include these two signals when it creates a full signal set.\n"
                },
                {
                    "name": "NPTL and process credential changes",
                    "content": "At the Linux kernel level, credentials (user and group IDs) are a per-thread attribute.  How‐\never,  POSIX  requires  that all of the POSIX threads in a process have the same credentials.\nTo accommodate this requirement, the NPTL implementation wraps all of the system  calls  that\nchange process credentials with functions that, in addition to invoking the underlying system\ncall, arrange for all other threads in the process to also change their credentials.\n\nThe implementation of each of these system calls involves the use of a real-time signal  that\nis sent (using tgkill(2)) to each of the other threads that must change its credentials.  Be‐\nfore sending these signals, the thread that is changing credentials  saves  the  new  creden‐\ntial(s)  and  records the system call being employed in a global buffer.  A signal handler in\nthe receiving thread(s) fetches this information and then uses the same system call to change\nits credentials.\n\nWrapper functions employing this technique are provided for setgid(2), setuid(2), setegid(2),\nseteuid(2), setregid(2), setreuid(2), setresgid(2), setresuid(2), and setgroups(2).\n"
                }
            ]
        },
        "CONFORMING TO": {
            "content": "For details of the conformance of NPTL to the POSIX standard, see pthreads(7).\n",
            "subsections": []
        },
        "NOTES": {
            "content": "POSIX says that any thread in any process with access to the  memory  containing  a  process-\nshared (PTHREADPROCESSSHARED) mutex can operate on that mutex.  However, on 64-bit x86 sys‐\ntems, the mutex definition for x86-64 is incompatible with the  mutex  definition  for  i386,\nmeaning that 32-bit and 64-bit binaries can't share mutexes on x86-64 systems.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "credentials(7), pthreads(7), signal(7), standards(7)\n",
            "subsections": []
        },
        "COLOPHON": {
            "content": "This  page  is  part  of  release  5.10 of the Linux man-pages project.  A description of the\nproject, information about reporting bugs, and the latest version of this page, can be  found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nLinux                                        2015-08-08                                      NPTL(7)",
            "subsections": []
        }
    },
    "summary": "nptl - Native POSIX Threads Library",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "credentials",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/credentials/7/json"
        },
        {
            "name": "pthreads",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/pthreads/7/json"
        },
        {
            "name": "signal",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/signal/7/json"
        },
        {
            "name": "standards",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/standards/7/json"
        }
    ]
}