From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9429 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] add sched_getcpu Date: Tue, 1 Mar 2016 17:34:19 -0500 Message-ID: <20160301223419.GL9349@brightrain.aerifal.cx> References: <1456764572-18648-1-git-send-email-nathan@nathan7.eu> <1456780194.12169.25.camel@xiaoka.com> <20160229213057.GE9349@brightrain.aerifal.cx> <1456864521.12169.35.camel@xiaoka.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1456871676 25504 80.91.229.3 (1 Mar 2016 22:34:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2016 22:34:36 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9442-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 01 23:34:36 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1aassG-0003oN-0z for gllmg-musl@m.gmane.org; Tue, 01 Mar 2016 23:34:36 +0100 Original-Received: (qmail 7640 invoked by uid 550); 1 Mar 2016 22:34:33 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7622 invoked from network); 1 Mar 2016 22:34:32 -0000 Content-Disposition: inline In-Reply-To: <1456864521.12169.35.camel@xiaoka.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:9429 Archived-At: On Tue, Mar 01, 2016 at 09:35:21PM +0100, Tomasz Sterna wrote: > W dniu 29.02.2016, pon o godzinie 16∶30 -0500, użytkownik Rich Felker > napisał: > > There are a lot of Linux specific syscalls without libc wrappers. > > > Is this one special enough? > > I wouldn't say there are a lot; do you have a list? > > $ grep -roh 'syscall(SYS_[a-z]*' src/kits/kernel/ | sort -u > syscall(SYS_exit SYS_exit cannot be used safely unless you have a single-threaded program, and in that case you can use _exit (SYS_exit_group). > syscall(SYS_futex There's work on getting glibc to expose futex, but I want to ensure that we do it in a compatible (in terms of types used, and where the declaration and macros get defined) way, so I'm waiting til we reach consensus on that to take any action in musl. > syscall(SYS_gettid For glibc it's been controversial whether to expose tids as a public API, since it pokes through the pthread abstraction and imposes a 1:1 threads implementation. My view is that, unless you want to write a gigantic framework emulating each blocking syscall in userspace, POSIX already imposes a 1:1 threads implementation, and it's stupid to still pretend that M:N is viable. > syscall(SYS_tgkill tgkill also requires tids to be exposed an potentially has other issues, and doesn't seem to offer anything that pthread_kill doesn't. > > The topic of what should and should not be given libc wrappers has > > been under discussion on the glibc list for a while now. [...] > > You should not need to use syscall() to access any Linux > > functionality that's meant to be exposed to applications; [...] > > Really depends on how you define "applications". I mean syscalls that are intended for writing application programs rather than for implementing the userspace part of C/POSIX. > Basically why I asked the question - if the above should also be > wrapped, I am all for it. But if not, why some syscalls are special? I hope I've answered this to some extent. If not please elaborate on what specific things aren't clear. Rich