From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A6B9394841C; Wed, 19 May 2021 20:27:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A6B9394841C From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug nptl/27880] Please provide a pthread pid accessor Date: Wed, 19 May 2021 20:27:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: adhemerval.zanella at linaro dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2021 20:27:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27880 --- Comment #7 from Adhemerval Zanella --- I think the TID value is what he is has in mind, assuming that prototype in comment #1 returns 'pid_t'. For thread exit/cancelled I think the sensible way would to return an error= to indicate it. Another issue, which I think also there is no guaranteee, is calling the newer interface with pthread_self() on a vfork process (since t= he tid won't be update and I am assuming the straightforward solution would be= to just atomic read the TID field in struct pthread). Also I am not sure about the name, pthread_gettid_np seems sensible but I am not sure if it make sense for non-Linux systems. --=20 You are receiving this mail because: You are on the CC list for the bug.=