Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751905AbcDRCQO (ORCPT ); Sun, 17 Apr 2016 22:16:14 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48260 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbcDRCQN (ORCPT ); Sun, 17 Apr 2016 22:16:13 -0400 Subject: Re: [PATCH v2 0/2] vfs: Define new syscall getumask. To: Josh Triplett , Greg KH References: <1460552272-15985-1-git-send-email-rjones@redhat.com> <2143735451.55767.1460561962122.JavaMail.zimbra@efficios.com> <1736004700.56566.1460581285951.JavaMail.zimbra@efficios.com> <20160414021348.GB16656@thunk.org> <57142C80.6070005@zytor.com> <20160418010925.GA7800@kroah.com> <20160418021259.GB16600@x> Cc: "Theodore Ts'o" , Mathieu Desnoyers , "Richard W.M. Jones" , linux-kernel@vger.kernel.org, Thomas Gleixner , mingo@redhat.com, Andrew Morton , luto@kernel.org, viro@zeniv.linux.org.uk, zab , emunson@akamai.com, "Paul E. McKenney" , Andrea Arcangeli , Pavel Emelyanov , sfr@canb.auug.org.au, Milosz Tanski , rostedt , arnd@arndb.de, ebiederm@xmission.com, gorcunov , iulia manda21 , dave hansen , mguzik , adobriyan@gmail.com, Davidlohr Bueso , linux-api , gorcunov@gmail.com, fw@deneb.enyo.de, Linus Torvalds From: "H. Peter Anvin" Message-ID: <57144343.4090402@zytor.com> Date: Sun, 17 Apr 2016 19:15:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160418021259.GB16600@x> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1233 Lines: 25 On 04/17/16 19:12, Josh Triplett wrote: >> >> I really like the 'libinux' idea, did anyone every hack up a first-pass >> at this? And I'm guessing we have more syscalls now that would need to >> be added (like getrandom(), but that shouldn't be too difficult. > > Personally, I'd suggest that libinux should wire up *all* (non-obsolete) > syscalls, not just those that haven't already been exposed via any > particular libc implementation. Each such syscall function would have > minimal overhead, since unlike libc these wrappers would not have any > special handling (other than use of the vdso) and would directly map to > the kernel syscall signature. Given a standard prefix like sys_ or > linux_, that would provide a clear distinction between direct-syscall > functions and libc functions, and avoid any future conflict if libc adds > a function named the same as the syscall. > > As a random example, sys_getpid() would *always* call the getpid > syscall, rather than reading a cache within the library. (And > sys_gettid would call the gettid syscall, rather than failing to exist.) > I'm not so sure this is a good idea. It has definite pros and cons. In some ways it pushes it more to be like syscall(3). -hpa