From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69F34C43331 for ; Tue, 12 Nov 2019 22:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D14720674 for ; Tue, 12 Nov 2019 22:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726923AbfKLW2w (ORCPT ); Tue, 12 Nov 2019 17:28:52 -0500 Received: from albireo.enyo.de ([37.24.231.21]:38498 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfKLW2v (ORCPT ); Tue, 12 Nov 2019 17:28:51 -0500 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1iUeeX-0003p6-9b; Tue, 12 Nov 2019 22:28:49 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1iUeeX-0007Tc-6x; Tue, 12 Nov 2019 23:28:49 +0100 From: Florian Weimer To: enh Cc: "Michael Kerrisk \(man-pages\)" , linux-man@vger.kernel.org Subject: Re: [PATCH] pthread_kill.3: Update to match POSIX. References: <87imnodbct.fsf@mid.deneb.enyo.de> <877e44daom.fsf@mid.deneb.enyo.de> <87woc4bv9c.fsf@mid.deneb.enyo.de> Date: Tue, 12 Nov 2019 23:28:49 +0100 In-Reply-To: (enh's message of "Tue, 12 Nov 2019 14:22:44 -0800") Message-ID: <87imnobufy.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-man-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org * enh: > but this is all about *invalid* threads, which obviously can't be > joinable. i'm really not sure what you're trying to say. Uhm, people try use pthread_kill to probe for thread termination. Termintation of a non-detached thread doesn't make a thread non-joinable, so from a temporal memory safety perspective, that's totally fine. Except that POSIX requires implementations to hide this information from callers. Maybe we are talking past each other, though. Let's look at what musl does: int pthread_kill(pthread_t t, int sig) { int r; LOCK(t->killlock); r = t->tid ? -__syscall(SYS_tkill, t->tid, sig) : (sig+0U >= _NSIG ? EINVAL : 0); UNLOCK(t->killlock); return r; } The 0 could be ESRCH to support probing for termination.