Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3242982imu; Sat, 24 Nov 2018 00:55:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xry3admY0CAR5UKVm8zJTl23ESftwgq6aYUpY/8D8h8EMfb20QejIzeGpfMmnWQVYSdX66 X-Received: by 2002:a63:224f:: with SMTP id t15mr17084685pgm.69.1543049726290; Sat, 24 Nov 2018 00:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543049726; cv=none; d=google.com; s=arc-20160816; b=Mg0Ocpl9S7SRwPCSIY30UOI3DvLhlNzO3RQPaFnG0xtHyxSst+15WR4hLl5Qq8T2Dq yWDxuusphN3EwhvnOW+Di5S6wYMhaO9z4oJSxh9seyaf26wWwPKFHrnFFz5zPRRUNaym 17LZgEg5S0kyQvXsVHiZiF956GrMgrA4XQsRX3wqJMj2rAarN/brtG4JcBZuxYHjRmZS fZKT334weJHCjBzVVi1hZoN/UDAY4p2U8QOTVnnLix5aIqgemqNe4UjMh5bNeMqbuzqK 5tMk2cUXAowcVYZTUqNbBpTKJKDBXt3OULmdUwGst8y2DnTYXQuFMFsnPngfrK7unMrv U8tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=oBEFhOXkRiyaovGPExtb2CAyQ7g87z7Ov/U5wfE9aMg=; b=FAjKFo863gw9z007/GcvATVqhp3iNAQE3IrT7wjMtFxH0a5f9j76BOOj7yOEiydAYL xA+1nm5Iide3ngEl77HNLlwpvjLgAPvhw/6+MuIcuNeKjufc1nt7zGoFfpkCJwN6zL7F D+3bsFh2qiyZRZKioAe/8oHTpXWd/AimuI91Xhu5lrE6062eDQN5GUtCSaceq5o/kZ6T SZTA2Zd/VHde097rLaZsnwdpgiDqM40Nt5zOH52k1e1VdbS2TgR7zGWSeNKZHAngcPWH WPWYYrRnz4pLh4snTZV9Ar0uciUn5nASRif/hv75IVEqCyM7EfA+IXKbBwV76TehZdUU GYqw== 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 e8si44697083pgn.325.2018.11.24.00.55.12; Sat, 24 Nov 2018 00:55:26 -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 S1727684AbeKXKFk (ORCPT + 99 others); Sat, 24 Nov 2018 05:05:40 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:50052 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727607AbeKXKFj (ORCPT ); Sat, 24 Nov 2018 05:05:39 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 8B0DA72CC61; Sat, 24 Nov 2018 02:19:24 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 5DFD17CD0D5; Sat, 24 Nov 2018 02:19:24 +0300 (MSK) Date: Sat, 24 Nov 2018 02:19:24 +0300 From: "Dmitry V. Levin" To: Daniel Colascione Cc: Michael Kerrisk-manpages , Joel Fernandes , Willy Tarreau , Vlastimil Babka , GNU C Library , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Official Linux system wrapper library? Message-ID: <20181123231924.GA15954@altlinux.org> Mail-Followup-To: Daniel Colascione , Michael Kerrisk-manpages , Joel Fernandes , Willy Tarreau , Vlastimil Babka , GNU C Library , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org References: <877ehjx447.fsf@oldenburg.str.redhat.com> <875zx2vhpd.fsf@oldenburg.str.redhat.com> <87efbbvrx9.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 23, 2018 at 12:15:39PM -0800, Daniel Colascione wrote: > On Fri, Nov 23, 2018 at 5:34 AM Florian Weimer wrote: > > > On Mon, Nov 12, 2018 at 12:11 AM, Florian Weimer wrote: > > >> > > >>> If the kernel provides a system call, libc should provide a C wrapp= er > > >>> for it, even if in the opinion of the libc maintainers, that system > > >>> call is flawed. > > >> > > >> It's not that simple, I think. What about bdflush? socketcall? > > >> getxpid? osf_gettimeofday? set_robust_list? > > > > > > What about them? Mentioning that these system calls exist is not in > > > itself an argument. > > > > But socketcall does not exist on all architectures. Neither does > > getpid, it's called getxpid on some architectures. >=20 > So what? On systems on which a given system call does not exist, > attempts to link against that system call should fail, or attempts to > make that system call should fail at runtime with ENOSYS. That's > completely expected and unsurprising behavior, not some unavoidable > source of catastrophic confusion. I'm sorry but you've just said that getpid() must either be unavailable or fail on those architectures that provide no syscall with exactly the same semantics as getpid syscall. Nobody is going to use a libc that doesn't provide getpid() in a reliable way. If you really need a 1-1 correspondence between syscalls and C wrappers, there is syscall(3) with all associated portability issues. If you need something else, please be more specific, i.e. be ready to give a detailed answer about every syscall ever supported by the kernel, on every supported architecture. My first trivial question is, do you need C wrappers for __NR_epoll_create, __NR_eventfd, __NR_inotify_init, and __NR_signalfd syscalls? --=20 ldv --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb+Ir8AAoJEAVFT+BVnCUI9jUQAJxPxURTe4+lhlpMh+pinvW0 PNzhRbRHJqPClAoJxlSwV+60dKckTt4c3cMEa8jKgLEYG4cXNrEmmlzJ00I9p0k0 qIw5soU65FkXh+HAfYAL6ujwJI3oxfTse79Q5PvD5WggaKIRKD8cQ0OvxlL8NU2k UJoVj2Js4RWybxQdgcaPIg+ciJltCVT+PXmK1h8fvJmXBgq3MefA88MKTDBEY8vz 3hFOBt4K33anedsyMRiD7IJ50ml93AFtJCko9eGNiLQH1XjyczRg9JkkiKS9aFkQ ly/07mAM3qC7xqTJDONA50eOSS94NC30luHri7bVnfG0e7T4uxaXFeJeyxa+r4fP DUnKcQc+9lThYqVHHArJNY2sscKLILuhMdfM5d/d9XftSTImJv2fqJ5cRzhgz/7Z P8WkL9QFBY7TxOmtFh4V2KjVQswt8CDnfAcZr5cTvogsrW9JFChbDK0MBlMqOWQc 0SB5Wl/prVR4XHReMjpuf6A/vC5hoDEIW7XR865wmA4/+N+7mvRGcU74RRuom+TL 9JE9fyM+7g86Sf9IiCWBf96GbYJr9+YbU7kYJ7BZgQMgwrIwWheJoWI7Q8dAVC1y pj/uE3cqW9UzDCYnkYmRmieyhfdVyBwWyw8USTGGdrRO62aU3sDf9LHVr8hArOU5 30L4FgEAHpngDSk2MNUN =0Jgr -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--