From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10016 Path: news.gmane.org!not-for-mail From: Alexander Monakov Newsgroups: gmane.linux.lib.musl.general Subject: Re: Deduplicating __NR_* and SYS_* syscall defines Date: Tue, 10 May 2016 10:34:48 +0300 (MSK) Message-ID: References: <20160510002637.GA21262@dora.lan> 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 1462865706 25811 80.91.229.3 (10 May 2016 07:35:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 May 2016 07:35:06 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10029-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 10 09:35:05 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 1b02C9-0006CL-0L for gllmg-musl@m.gmane.org; Tue, 10 May 2016 09:35:05 +0200 Original-Received: (qmail 7868 invoked by uid 550); 10 May 2016 07:35:00 -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 7847 invoked from network); 10 May 2016 07:35:00 -0000 In-Reply-To: <20160510002637.GA21262@dora.lan> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) Xref: news.gmane.org gmane.linux.lib.musl.general:10016 Archived-At: On Mon, 9 May 2016, Bobby Bingham wrote: > The handling for #undef is for the x32 file. It looks like only the > `#undef __NR_getdents' in that file is actually necessary, and even that > could be avoided by just omitting the earlier line: > > #define __NR_getdents (__X32_SYSCALL_BIT + 78) > > So maybe we can get rid of the #undefs there, and simplify the awk script > accordingly. +1, seems pointless to define something only to undefine a few lines later. And the inconsistency between undefs (the other three undef something that wasn't even defined earlier) is puzzling. Finally, __NR_fadvise is not undef'ed before definition like the other four. > Thoughts on this approach? If this sounds ok, I'll submit a patch. It's possible to avoid interleaving __NR_ and SYS_ definitions and keep current structure mostly intact: cp $< $@ sed -e /^#define/s/__NR_/SYS_/p < $< >> $@ (bits/syscall.h is not included on its own, so it lacks include guards) Thanks for looking into this! Alexander