aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/nptl/pthread.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-03-12 10:16:31 +0100
committerFlorian Weimer <fweimer@redhat.com>2025-03-12 10:23:35 +0100
commit74d463c50bb1096efef47022405c7db33f83fb5a (patch)
tree7a61f4db59c8bd43d1213d6d137aff51fff0588d /sysdeps/nptl/pthread.h
parentd604f9c500570e80febfcc6a52b63a002b466f35 (diff)
downloadglibc-74d463c50bb1096efef47022405c7db33f83fb5a.zip
glibc-74d463c50bb1096efef47022405c7db33f83fb5a.tar.gz
glibc-74d463c50bb1096efef47022405c7db33f83fb5a.tar.bz2
Linux: Add the pthread_gettid_np function (bug 27880)
Current Bionic has this function, with enhanced error checking (the undefined case terminates the process). Reviewed-by: Joseph Myers <josmyers@redhat.com>
Diffstat (limited to 'sysdeps/nptl/pthread.h')
-rw-r--r--sysdeps/nptl/pthread.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h
index 050b4ab..b4d10a3 100644
--- a/sysdeps/nptl/pthread.h
+++ b/sysdeps/nptl/pthread.h
@@ -1317,6 +1317,11 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
__THROW __nonnull ((2));
#endif
+#ifdef __USE_GNU
+/* Return the Linux TID for THREAD_ID. Returns -1 on failure. */
+extern pid_t pthread_gettid_np (pthread_t __thread_id);
+#endif
+
/* Install handlers to be called when a new process is created with FORK.
The PREPARE handler is called in the parent process just before performing