From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH v2 0/2] vfs: Define new syscall getumask. Date: Sun, 17 Apr 2016 19:15:31 -0700 Message-ID: <57144343.4090402@zytor.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20160418021259.GB16600@x> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Josh Triplett , Greg KH Cc: Theodore Ts'o , Mathieu Desnoyers , "Richard W.M. Jones" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Thomas Gleixner , mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, Andrew Morton , luto-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org, zab , emunson-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org, "Paul E. McKenney" , Andrea Arcangeli , Pavel Emelyanov , sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org, Milosz Tanski , rostedt , arnd-r2nGTMty4D4@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, gorcunov , iulia manda21 , dave hansen , mguzik , adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Davidlohr Bueso , linux-api , gorcunov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, fw-d32yF4oPJVt0XxTmqZlbVQ@public.gmane.org, Linus List-Id: linux-api@vger.kernel.org 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