From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9413 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] add sched_getcpu Date: Mon, 29 Feb 2016 23:17:07 +0300 (MSK) Message-ID: References: <1456765028-23958-1-git-send-email-nathan@nathan7.eu> <1456765216-24883-1-git-send-email-nathan@nathan7.eu> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1456777050 11154 80.91.229.3 (29 Feb 2016 20:17:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Feb 2016 20:17:30 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-9426-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 29 21:17:23 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 1aaUFs-00072m-Sk for gllmg-musl@m.gmane.org; Mon, 29 Feb 2016 21:17:21 +0100 Original-Received: (qmail 3594 invoked by uid 550); 29 Feb 2016 20:17:18 -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 3574 invoked from network); 29 Feb 2016 20:17:18 -0000 In-Reply-To: User-Agent: Alpine 2.20 (LNX 67 2015-01-07) Xref: news.gmane.org gmane.linux.lib.musl.general:9413 Archived-At: > > As far as I can tell, syscall() is supposed to set errno (using > > __sycall_ret), but maybe src/misc/syscall.c isn't what I think it is? > > > I indeed got the return value backwards, and I'll fix that, along with the > > #ifdef. > > > Actually, nope, that ternary is the right way round, and __sycall_ret > handles the -1 return. Ah, indeed my original objection was wrong; however please note that you're not calling syscall from src/misc/syscall.c here; it's #defined in src/internal/syscall.h to __syscall_ret(__syscall(...)), and the typical usage in musl internally is either tailcalling to syscall, or calling __syscall where handling provided by __syscall_ret is not useful. I'd recommend using __syscall and __syscall_ret here. Alexander