mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: Deduplicating __NR_* and SYS_* syscall defines
Date: Tue, 10 May 2016 10:34:48 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.20.1605101010350.31992@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20160510002637.GA21262@dora.lan>

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


  reply	other threads:[~2016-05-10  7:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  0:26 Bobby Bingham
2016-05-10  7:34 ` Alexander Monakov [this message]
2016-05-10  8:47   ` Alexander Monakov
2016-05-11 21:53 ` Rich Felker
2016-05-12  0:22   ` Bobby Bingham
2016-05-12  0:57     ` Rich Felker
2016-05-12  3:56       ` Bobby Bingham
2016-05-13 10:15       ` Szabolcs Nagy
2016-05-13 16:02         ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.20.1605101010350.31992@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).