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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 54DCDC43441 for ; Mon, 12 Nov 2018 22:51:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D2CE2241E for ; Mon, 12 Nov 2018 22:51:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D2CE2241E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729470AbeKMIqZ (ORCPT ); Tue, 13 Nov 2018 03:46:25 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:52692 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbeKMIqY (ORCPT ); Tue, 13 Nov 2018 03:46:24 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-03.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gML2y-0006bm-GV from joseph_myers@mentor.com ; Mon, 12 Nov 2018 14:51:08 -0800 Received: from digraph.polyomino.org.uk (137.202.0.90) by SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 12 Nov 2018 22:51:04 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1gML2t-00058c-R6; Mon, 12 Nov 2018 22:51:03 +0000 Date: Mon, 12 Nov 2018 22:51:03 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Daniel Colascione CC: Florian Weimer , Zack Weinberg , "Michael Kerrisk (man-pages)" , Linux Kernel Mailing List , Joel Fernandes , Linux API , Willy Tarreau , Vlastimil Babka , Carlos O'Donell , GNU C Library Subject: Re: Official Linux system wrapper library? In-Reply-To: Message-ID: References: <877ehjx447.fsf@oldenburg.str.redhat.com> <875zx2vhpd.fsf@oldenburg.str.redhat.com> <87lg5ym7qi.fsf@oldenburg.str.redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Nov 2018, Daniel Colascione wrote: > The two features *are* unrelated. The design I've proposed works > equally well for synchronous and asynchronous signals, and limiting it Whatever the design, I see no obvious reason why a kernel-provided library, with all the problems that entails, should need to be involved, rather than putting new APIs either in libc or in a completely separate libsignal for libraries wanting to use such a system for cooperative signal use. (I can imagine *other* parts of the toolchain being involved, if e.g. you want to have a good way of checking "is the address of the instruction causing this signal in this library?" that works with static as well as dynamic linking - for dynamic linking, I expect something could be done using libc_nonshared and __dso_handle to identify code in the library calling some registering function. And indeed there might also be new kernel interfaces that help improve signal handling.) In the absence of consensus for adding such a new API for signals to glibc, it's unlikely one would get consensus for glibc to depend on some other library providing such an API either. But you can always write a library (which I think would most naturally be a completely separate libsignal, not part of the kernel source tree) and seek to persuade libraries they should be using it rather than interfering with global state by registering normal signal handlers directly. -- Joseph S. Myers joseph@codesourcery.com