Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4686750imu; Mon, 12 Nov 2018 15:29:08 -0800 (PST) X-Google-Smtp-Source: AJdET5doUtBXLq2VZUtjAL4r27T97l7dT67qsgTmdcqZQSQcH8Nzj9uXokMfb5OAfsQSO9FpUmd2 X-Received: by 2002:a63:e4d:: with SMTP id 13mr2040829pgo.369.1542065348364; Mon, 12 Nov 2018 15:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542065348; cv=none; d=google.com; s=arc-20160816; b=XCdr+xti7wdUKBVUcpEYSTh5tKBVT3Q7/tCijdCGrj2iHFWvwF0zfnZoxapGfA+wjM w60tdm0XsPowSYjbvJD+9CUxU0gOBILIYKAA9VapPApMjpiifgu5wNWwKHMPQTI6bVWf psUOM1rpAlxshImtfC1RaR7RG9uhxWYKrlN6ptIzV5reRVe+BD/FYXvcb1FmHMcai7tk Y+8XYV67TDN8/Ax514U1lT41vImmNI35h879x/vWOpakO2ja3In9BZkNTzMfifHJyRmN 2Shx4TlWlWYYgH4MVeEkB1brrNqzy/jW35Co7ZBS3hXmQoh4W40eWz0ib34WgHZFuVDh ihFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=zhJYF8H60pD+A06RB4jJyNhtX0Mqk7JkNiuVu/xrI0E=; b=0BZEFinCk+VBLdHNGToFS/jpZQEdwJ65DrMi98IN76I+N3vbQLTTdO4MObp8muiX+7 00UPJ7FdDL8C8sQRo76QFeG8+KTR/lWHQeIypLT32a2fM0w7hxTni1Of8LS7cAtIroPV EVR1gD8Nuaa8kFo45yPnP7NXxQI4A2+kh4BipBfRQjnx1ZVMWsVD0EmsiKRJiCFtG5iA WYE9FUEGJzCr0awJD07TlNawCNy3/ELjN+WpQUFMASDt7RoxznS3f0q3muNmJPS30kCL STTcgsWmmD8cMx5GE7Gkkpzb244vmr42jSEELyB8sLat6UWHgXYbVcvZHQTHWEzLRoqY /u6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11-v6si12335159pfe.186.2018.11.12.15.28.50; Mon, 12 Nov 2018 15:29:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730305AbeKMJWZ (ORCPT + 99 others); Tue, 13 Nov 2018 04:22:25 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:53473 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726078AbeKMJWZ (ORCPT ); Tue, 13 Nov 2018 04:22:25 -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 1gMLbi-00022a-PD from joseph_myers@mentor.com ; Mon, 12 Nov 2018 15:27:02 -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 23:26:59 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1gMLbe-0005Rs-Hg; Mon, 12 Nov 2018 23:26:58 +0000 Date: Mon, 12 Nov 2018 23:26:58 +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-08.mgc.mentorg.com (139.181.222.8) 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: > I initially wanted to put the APIs in libc. I still do. But that's > proving to be impractical, for the reasons we're discussing on this > thread. Well, your proposed APIs didn't attract consensus among libc developers. > > (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.) > > Again: you're blocking a practical solution for the sake of some > elegant theoretical implementation that will never arrive, and so the I'm not - I'm observing various areas that might be open to improvements related to signal handling, not saying improvements in one area are a prerequisite to improvements in another. I'm exploring the problem and solution space, and collectively exploring the problem and solution space is an important part of trying to work out where there might be useful future improvements related to the general issue of signal handling. Exploring the problem and solution space can include coming to the conclusion that an idea that seems obvious is in fact a bad idea, or in fact orthogonal to other ideas that are independently useful - those things are still useful in yielding a better rationale for taking a given approach. > > 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. > > glibc would continue using an unsupported legacy system call > interfaces in lieu of a supported low-level interface library? The Linux kernel supports the interfaces that people actually use, on the principle of not breaking userspace, not the interfaces that someone would like to declare to be the supported ones. We'd use the interfaces that seem suitable for use by glibc, and direct syscalls seem more suitable to me than any kernel-provided userspace library. Naturally a library invented in the kernel on the basis of not liking what libc people are doing or not doing is unlikely to be suitable for use by libc (and use together with libc of anything in it that interferes with libc functionality such as sigaction might be explicitly discouraged by libc maintainers, just as e.g. direct use of clone can be discouraged) - whereas interfaces developed collaboratively with libc implementations and getting consensus from those users are more likely to be of use to libc implementations. -- Joseph S. Myers joseph@codesourcery.com