Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2267593imu; Sat, 10 Nov 2018 11:02:13 -0800 (PST) X-Google-Smtp-Source: AJdET5cNMm0QWlUVn/QcyiMha9Ra/7rE+gnbCrP4H+fau4ZkAE5bPFENy4oW9JMX5bbWizJIrb/r X-Received: by 2002:a17:902:ab83:: with SMTP id f3-v6mr13251621plr.122.1541876533245; Sat, 10 Nov 2018 11:02:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541876533; cv=none; d=google.com; s=arc-20160816; b=KJuoDsc5iAtvsri+vBviC0aDvSXgCi13/YZTAnLhC72rmj/r/sh3r8VyNxQ8FVFSuJ usibjVxsu7vdIXPs7Sje7CHUkO7pxYpwArqBWjBEVJChfHsW+rE4M9XDexrXGFwbZvEB BWC1tFA+1ioYLCK3a2oy4wmyM/+shOw9f1luAT7iMKnKIsaQuuuMr1m/I8LcXzOe0B8y SvQlxKvAPkacADHP5n/UzmUeaTL8nPMEehQfXfncHA8OVOR+KMyPZeOLLqL+IEZDdgCu 2wzlIpXcob7bvOu9fC17bSK3digHZSljox77NIjfZCCHYlyHbp0kD04GdE6CVhXp8Bak OD/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yqh/HboCtztLXsY0kRIf80BnMkw+EHUA650P6Sgf63I=; b=UVeg5W+8D83a1L2pEiVngOxkTI1MzjOkPvNXaM2h1nemU31vezqvjI5ZWXCk23ckT+ J9DM8GaTxokHu98L2c/RWFCMB00CPVtHwiuYerBnU2ZbL5vrzTrSkcNionIoECq7EkRx t/8gIXUNeELe10LpSaSWItTV9Pb9mjzec7hLRZzMOHo0VWUB24bHK4xfolt9BRX6kAia 0QtjfvAxVN2jx9LVnSbLSDeV9VQ4pFuFuTZGycNsX8kQOFk7nTHqs7Wdv2MK+rouXKT4 sGXY1E6VbJl5E+UmmMHN5GO50Q6Rv7W+4r+qyrkOzj7xJVJpm644KkGa2QFV+xsgL/LT ttoQ== 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 66-v6si12966278pfv.38.2018.11.10.11.01.57; Sat, 10 Nov 2018 11:02:13 -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 S1726653AbeKKErg (ORCPT + 99 others); Sat, 10 Nov 2018 23:47:36 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:41670 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbeKKErg (ORCPT ); Sat, 10 Nov 2018 23:47:36 -0500 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id wAAJ1WEn021192; Sat, 10 Nov 2018 20:01:32 +0100 Date: Sat, 10 Nov 2018 20:01:32 +0100 From: Willy Tarreau To: Daniel Colascione Cc: linux-kernel , Joel Fernandes , Linux API Subject: Re: Official Linux system wrapper library? Message-ID: <20181110190132.GA21185@1wt.eu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 10, 2018 at 10:52:06AM -0800, Daniel Colascione wrote: > Now that glibc is basically not adding any new system call wrappers, > how about publishing an "official" system call glue library as part of > the kernel distribution, along with the uapi headers? I don't think > it's reasonable to expect people to keep using syscall(__NR_XXX) for > all new functionality, especially as the system grows increasingly > sophisticated capabilities (like the new mount API, and hopefully the > new process API) outside the strictures of the POSIX process. It's partly related, but you may be interested in something I did that is in the the RCU tree. It's called "nolibc", it's a set of syscall wrappers defined only in include files. It's not complete, but still enough to boot some small init wrappers. Mine can extract tar files and do stuff like this with it. Here is the kernel port in the RCU tree and an example of code using it : https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/tree/tools/testing/selftests/rcutorture/bin/nolibc.h?h=rcu/next https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/tree/tools/testing/selftests/rcutorture/bin/mkinitrd.sh?h=rcu/next The original one is maintained here (not very active since it works well enough for my use cases now eventhough it's far from being complete) : http://git.formilux.org/?p=people/willy/nolibc.git Maybe something along this could be done for the vast majority of syscalls and the thicker stuff be left to glibc ? That would allow simple userland to build without glibc using only kernel headers, or by occasionally defining a few extra stuff or glue. Willy