[Bug libc/6399] gettid() should have a wrapper

mtk.manpages at gmail dot com sourceware-bugzilla@sourceware.org
Fri Oct 9 19:16:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=6399

--- Comment #45 from Michael Kerrisk <mtk.manpages at gmail dot com> ---
(In reply to Nicholas Miell from comment #44)
> Well, if we're going to be making design proposals:
>  
> PIDs (and TIDs) are inherently racy and every API that uses them is broken
> by design. No new APIs that use pid_t should be created, all existing should
> be deprecated.
> 
> They should be completely replaced by file descriptors obtained either from
> clone()'s return value (since fork() can't take flags) or by opening
> /proc/$PID (at which point you can safely inspect the process's attributes
> to verify you have a handle to the thing you wanted).

Nicholas,

I don't disagree with you, but you speak of an ideal world that does not (yet)
exist, and proposing to deprecate all of the existing APIs won't fly. Until
that ideal world exists, we need a solution to the current problems that
applications face. One day, assuming that Josh Triplett's clonefd() work hits
Linux mainline, we'll be closer to the ideal.

Thanks,

Michael

-- 
You are receiving this mail because:
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list