From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5160 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: [UGLY PATCH] Support for no-legacy-syscalls archs Date: Sun, 25 May 2014 10:57:50 +0100 Message-ID: References: <20140525054237.GA18085@brightrain.aerifal.cx> <20140525095257.GI12324@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1401011890 26137 80.91.229.3 (25 May 2014 09:58:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 May 2014 09:58:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5165-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 25 11:58:03 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WoVBr-0008LL-Eu for gllmg-musl@plane.gmane.org; Sun, 25 May 2014 11:58:03 +0200 Original-Received: (qmail 30314 invoked by uid 550); 25 May 2014 09:58:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30306 invoked from network); 25 May 2014 09:58:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B4v/pA49HCXtdUX2f982isWW7mCPxLq8Folrx4IUS6s=; b=qwa9sku/DVWkmfYXR0r9nLHDehTGfidFlkNPIz0LBtCZ35+7Mx10nsBRTkOIN/0dzj qvQPAcdjnq3MF4AHQtWw6ip9V4fLwWpN5fdQEcn9r9Q6Pvv0IDihDvT54Tj30oPv2EOI X0e1BfwFKOmgclTzBDwk6ikf3UJQuX3ZVHzT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=B4v/pA49HCXtdUX2f982isWW7mCPxLq8Folrx4IUS6s=; b=BOSPrMHZNezc/aHL9xx7s0xqYSDEuKybImroVXDbrbnaWEbAAOBJI980Fu2a5QNC2/ WvyZl1WtxqBCKbR4l2ZHpAmeKKokIEkqbDfZArrzt8h0SLhKiO2o1wrnpHOPR+ZBLyHw jTFQX8tiN6OYXYKIlWWxQ7XDLckpEDapyYi4AhqD/ko3B5FJcjoyAir9tZauA9NNEMpr a8BEmy1szuKw6JDKfPRlfdk3OmQlqI3qGvhYfgVWLLLrMqsudlzDafOgysWUhJ6Lz+3q isn65HzGf/DtIBRAZVCGMlbDhT0ZjQRBcPAGgdxcMPjq/sRD2d22+jcnk+xppbB0IUsC lrxw== X-Gm-Message-State: ALoCoQl2oo7osHT+UCuAw53o8AyTEird22PiomVVUmJjDLR84vXySkh2qWV2a4UCbOTeQZKXnhEG X-Received: by 10.182.227.197 with SMTP id sc5mr17539802obc.18.1401011870783; Sun, 25 May 2014 02:57:50 -0700 (PDT) In-Reply-To: <20140525095257.GI12324@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:5160 Archived-At: On Sun, May 25, 2014 at 10:52 AM, Szabolcs Nagy wrote: > * Rich Felker [2014-05-25 01:42:37 -0400]: >> Here's a proposed next phase for supporting no-legacy-syscall archs >> (aarch64 and or1k, among others). It's not complete but I think it >> covers most of the important syscalls for standard functionality (not >> linux-specific stuff tho). Some of them might be missing some error >> cases or otherwise buggy so I'm sending the patch for review before >> committing. > ... >> +#ifdef SYS_poll >> __syscall(SYS_poll, pfd, 3, 0); >> +#else >> + __syscall(SYS_ppoll, pfd, 3, 0, 0, _NSIG/8); >> +#endif > > cant it be done the other way around so new syscalls > are tried and then the classic ones are just fallbacks? Issue seems to be that if you were running an old kernel (say no ppoll) this would have to be called twice or add runtime conditionals, which would be slower. Also it means that strace shows closer to what you called. In many cases (where the new ones are Posix and portable) users should switch to the new calls, but some are Linux only. > and what will happen with SYS_open? Whats the issue with open? Justin