This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Linux: Add gettid system call wrapper [BZ #6399]
* Joseph Myers:
> On Wed, 5 Dec 2018, Florian Weimer wrote:
>
>> This commit adds gettid to <unistd.h> on Linux, and not to the
>> kernel-independent GNU API.
>
> This is missing a NEWS entry,
I plan to add this:
+* On Linux, the gettid function has been added.
> and documentation (which seems particularly
> important in this case, to discuss what a tid is and is not and what
> interfaces it can be used with).
I can put more details into the comment:
/* Return the kernel thread ID (TID) of the current thread. The
returned value is not subject to caching. Most Linux system calls
accept a TID in place of a PID. Using the TID to change properties
of a thread that has been created using pthread_create can lead to
undefined behavior (comparable to manipulating file descriptors
directly that have not been created explicitly). Note that a TID
uniquely identifies a thread only while this thread is running; a
TID can be reused once a thread has exited, even if the thread is
not detached and has not been joined. */
I do not want to contribute to the manual at this point.
I would rather improve the manpages project documentation and clarify
there when a PID is actually a TID and deals with what are essentially
task properties.
Should we have a separate conversation about the future of the manual?
Thanks,
Florian