Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2910757imu; Sun, 11 Nov 2018 03:48:00 -0800 (PST) X-Google-Smtp-Source: AJdET5cHhX2+OPYtJEtrs9HjiMhwiMz4K2eKM0MLrZESVgAfx+KcEJxNMwCmYAONSAVGWB/X8lfc X-Received: by 2002:a17:902:5ac6:: with SMTP id g6-v6mr60671plm.212.1541936880285; Sun, 11 Nov 2018 03:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541936880; cv=none; d=google.com; s=arc-20160816; b=bd/cZrjYNG1LmTLtxNQuXv1Dkv/t+hURXVw44B1He78bxg0k3qLrReO/+vyTNvi7im vhxmF0KhEjJfsVg3wXV/1rx/ZA8rarlJGefqtr0tHwsHiZwvmk6soDjjjoBChPMGxrkK orb8jZuf1fnEXKkClYtHJlm04do4G0Ikwdn3guu+DppVK8oH/y2m1vWRCQpEXT4qSGfx apUTXpNQU30yop4L35zksad33FqoH2LX89UT2CqMn2bWLQSejzBe4wsKvzASUdnpBB46 7a/GmdmYIcwUWOCrGnPMfuWenW1gdO23+6SFrYptrQRKKEMRUsU/n1sbmizBKU0OQIXe Biag== 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=5bX8V12qOxflXx5SaqFUcJmV0zSVIz1J2PDOJ5A0+1c=; b=GKVrHuuTHtkS9fudY+ba8tf1JUpn8hZQCKhZxkk+lOPFtYFIMcAB2rnRmXzmfrO2yq /YKSaNmQXbA4hNzCfjQTsFkFgVa6phCcl3cW/qmiScqYpQmXwe+AqlVnBe+3lkW3JhB2 W5gdVtjMYMmsfNK8eC3QQQ7zmOjZiZUy6HoBNH+sjGKM5GYr/TwuAE1dvmwkeh6L1+r7 1xPKJyp7dkDSpmw8wStID2R0AECw0VuUqSh9ixCUkJ9AF1CAQP2pt3kDSzS25zZCY1em BQsSfOJEKbtWmeVqXPdhiyIQw3a854q9dZmhqWD8ymJqC/QwvPl+E6AqD4k6y5HRvshK O37g== 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 185-v6si7585794pff.77.2018.11.11.03.47.44; Sun, 11 Nov 2018 03:48:00 -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 S1728006AbeKKVfG (ORCPT + 99 others); Sun, 11 Nov 2018 16:35:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50736 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727510AbeKKVfF (ORCPT ); Sun, 11 Nov 2018 16:35:05 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 127FF83F3C; Sun, 11 Nov 2018 11:46:45 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-74.ams2.redhat.com [10.36.116.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7B3D5C1B4; Sun, 11 Nov 2018 11:46:40 +0000 (UTC) From: Florian Weimer To: Willy Tarreau Cc: "Michael Kerrisk \(man-pages\)" , Daniel Colascione , linux-kernel , Joel Fernandes , Linux API , Vlastimil Babka , "Carlos O'Donell" , "libc-alpha\@sourceware.org" Subject: Re: Official Linux system wrapper library? References: <20181111081725.GA30248@1wt.eu> <3664a508-ca74-4ff0-39a6-34543194a24e@gmail.com> <20181111111143.GB4189@1wt.eu> Date: Sun, 11 Nov 2018 12:46:35 +0100 In-Reply-To: <20181111111143.GB4189@1wt.eu> (Willy Tarreau's message of "Sun, 11 Nov 2018 12:11:43 +0100") Message-ID: <87zhufvntw.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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 11 Nov 2018 11:46:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Willy Tarreau: > I think the issue is a bit more complex : > - linux doesn't support a single libc > - glibc doesn't support a single OS > > In practice we all know (believe?) that both statements above are > true but in practice 99% of the time there's a 1:1 relation between > these two components. Eh. Most Linux systems do not run glibc at all (and use cryptography and other tricks to prevent users from installing it). > What we'd really need would be to have the libc > interface as part of the operating system itself. I'm perfectly fine > with glibc providing all the "high-level" stuff like strcpy(), FILE* > operations etc, and all this probably is mostly system-independent. That's a bit messy, unfortunately. The kernel does not know about TCB layout, so a lot of low-level threading aspects are defined by userspace. The kernel does not know about POSIX cancellation. Directly calling system calls breaks support for that. A lot of multi-threaded applications assume that most high-level functionality remains usable even after fork in a multi-threaded process. (This is increasingly a problem today with all those direct calls to clone.) Unfortunately, this introduces rather tricky low-level/high-level cross-subsystem issues, too. > But the system interface could possibly be handled easier in the > system itself, which would also provide a smoother adoption of new > syscalls and API updates. It would also limit the hassle required to > provide new syscalls, as if you start to have to contribute to two > projects at once for a single syscall, it becomes really painful. Sure, the duplication is unfortunate. Several glibc contributors deeply care about standards compliance for header files. The kernel developers care not, and the result is that we copy definitions and declarations from the kernel header files, creating additional problems. We also want to use old kernel headers to compile glibc and still implement features which are only defined by newer (upstream) kernels, so that leads to more duplication. Thanks, Florian