From 1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 2 Feb 2019 15:17:02 +0100 Subject: Linux: Add gettid system call wrapper [BZ #6399] This commit adds gettid to on Linux, and not to the kernel-independent GNU API. gettid is now supportable on Linux because too many things assume a 1:1 mapping between libpthread threads and kernel threads. Reviewed-by: Carlos O'Donell --- manual/process.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'manual') diff --git a/manual/process.texi b/manual/process.texi index 652b0001b5..5728bde2cb 100644 --- a/manual/process.texi +++ b/manual/process.texi @@ -228,6 +228,17 @@ The @code{getppid} function returns the process ID of the parent of the current process. @end deftypefun +@deftypefun pid_t gettid (void) +@standards{Linux, unistd.h} +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +The @code{gettid} function returns the thread ID of the current +thread. The returned value is obtained from the Linux kernel and is +not subject to caching. See the discussion of thread IDs above, +especially regarding reuse of the IDs of threads which have exited. + +This function is specific to Linux. +@end deftypefun + @node Creating a Process @section Creating a Process -- cgit 1.4.1