Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 May 2016 10:34:48 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: Deduplicating __NR_* and SYS_* syscall defines

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.