Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4450396imu; Mon, 12 Nov 2018 11:12:08 -0800 (PST) X-Google-Smtp-Source: AJdET5fcgFClm2hzinca2GwN3PpxoE7zG5KYNq9vD6lLDDL2+bJmbimPe5BGIajvAbb4BZdDEHqB X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr2068612pla.7.1542049928796; Mon, 12 Nov 2018 11:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542049928; cv=none; d=google.com; s=arc-20160816; b=0iW3gA1V9EhluDjCoEKBas868yZun2imdgLPl0NLh2P0dwcFMls69MpQ3tgSYZhs7I dOXpTaL3WJ9b7TQ01LS9np9D4ttKB4b0Xrsgfu+ZptUxLEmbiuylfQUUOBeRzcwjVjp1 Y5OomchYDpnuj5Z0L1hkjrpHunA4qeVBRex0uq6xvLqBXvS6jriY8QxLaIenVtVD33ok 00WZO8wYbPaCIlvd/WVzihZc/bKAv+BUzV7495Y/FsJYsqEcb1ran7tR7YAYXWb+YrCB gYmydgOny29coyKT4J63T5ElIG+6I6Iys5RxcMGnCe9T0z3qFF5nD6IOApCgFXtLeey4 96ZA== 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:message-id :in-reply-to:date:references:subject:cc:to:from; bh=fxdiaelTnhge1n+jz2KAiYsPPlJTQNgN5j9JMdrYlf4=; b=idpCUAlNJWnNnuKvOYKO/bEjT8ZM7kDVoKQo/jGw4PgoUAZNrfYMttkEfN3yGeytGr UB0R27H0V3k6wnwbOg9dnl+h91v7PQPEHGGc5CKmefyd7van2ejt5XTgYJ7nZQrUnMzs 916BI6qgXc8YHx2Od/67pgLk9EmVPbNh1bw/CxV+fHhSWndiIqa0OPHaec/JUNeCfnZr IJIUXSVw94rXM/EecLkefrk+Kaxa+GuIUQnV9XJffuixLW2z1yYuv0x+juWVHnqIXoFq yD+n4+GU2Wffq4FVd8E1LXQOPUTZdGwGBMjIg1kjodvA5MMh/J011PXnC6T1tGWCMXot +88w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31-v6si19207520plb.15.2018.11.12.11.11.52; Mon, 12 Nov 2018 11:12: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726065AbeKMFGB (ORCPT + 99 others); Tue, 13 Nov 2018 00:06:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38004 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725754AbeKMFGB (ORCPT ); Tue, 13 Nov 2018 00:06:01 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58A1C83F44; Mon, 12 Nov 2018 19:11:27 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-54.ams2.redhat.com [10.36.116.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0DEB660C67; Mon, 12 Nov 2018 19:11:22 +0000 (UTC) From: Florian Weimer To: Daniel Colascione Cc: 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? References: <877ehjx447.fsf@oldenburg.str.redhat.com> <875zx2vhpd.fsf@oldenburg.str.redhat.com> Date: Mon, 12 Nov 2018 20:11:17 +0100 In-Reply-To: (Daniel Colascione's message of "Mon, 12 Nov 2018 10:28:56 -0800") Message-ID: <87lg5ym7qi.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 12 Nov 2018 19:11:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Daniel Colascione: > What about off_t differences? Again, it doesn't matter. From the > *kernel's* point of view, there's one width of offset parameter per > system call per architecture. The library I'm proposing would expose > this parameter literally. Does this mean the application author needs to know when to split an off_t argument into two, and when to pass it as a single argument, and when to insert dummy arguments for alignment, depending on the architecture? >> And that means you wouldn't get as much >> decoupling from the C and POSIX standards -- both of which specify at >> least part of those semantics -- as you want, and we would still be >> having these arguments. For example, it would be every bit as >> troublesome for liblinuxabi.so.1 to export set_robust_list as it would >> be for libc.so.6 to do that. > > Why? Such an exported function would cause no trouble until called, > and there are legitimate reasons for calling such a function. Not > everyone, as mentioned, wants to write a program that relies on libc. For that use case, a machine-readable system call ABI specification is the only reasonable approach: Some people want inline system calls, others want dedicated routines per system call. The calling convention for the dedicated functions will vary, and the way errors are handled as well. Some want connect calls to be handled by socketcall if possible, others prefer the direct call. The nice thing here is that once you settled for a particular approach, the functions are really small and will not change, so there is no real need for dynamic linking. The challenge here is to come up with a uniform description of the system call interface for all architectures, and for application programmer's sanity, make sure that the kernel adds generic system calls in a single version, across all architectures. > This stance in the paragraph I've quoted is another example of glibc's > misplaced idealism. As I've elaborated elsewhere, people use signals > for many purposes today. The current signals API is extremely > difficult to use correctly in a process in which multiple unrelated > components want to take advantage of signal-handling functionality. > Users deserve a cleaner, modern, and safe API. It's not productive > withhold improvements to the signal API and gate them on unrelated > features like process handles merely because, in the personal > judgement of the glibc maintainers, developers should use signals for > fewer things. The two aren't unrelated. If you take asynchronous signals out of the picture, the design becomes simpler and easier to use. Thanks, Florian