]> granicus.if.org Git - strace/commit
Stop using nargs == -1 in syscallent tables
authorDenys Vlasenko <dvlasenk@redhat.com>
Tue, 23 Aug 2011 11:24:17 +0000 (13:24 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Tue, 23 Aug 2011 11:24:17 +0000 (13:24 +0200)
commitac1ce77a23b4f4eecb6768f118259499308fce1c
tree68f45a9b0a4e09ac99736c77b7c05e6557920ed1
parented4f4f02f1b1c3a0902f74969948c4c1b777ff4a
Stop using nargs == -1 in syscallent tables

Usage -1 as argument count in syscallent tables
necessitates the check for it, a-la:
if (sysent[tcp->scno].nargs != -1)
    tcp->u_nargs = sysent[tcp->scno].nargs;
else
    tcp->u_nargs = MAX_ARGS;
which is stupid: we waste cycles checking something which
is constant and known at compile time.

* defs.h: Make struct sysent::nargs unsigned.
* freebsd/i386/syscallent.h: Replace nargs of -1 with MA.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* svr4/syscallent.h: Likewise.
* freebsd/syscalls.pl: Likewise in generator script.
* syscallent.sh: Likewise in generator script.
* syscall.c: Add define MA MAX_ARGS / undef MA around includes
of syscallent[N].h.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
defs.h
freebsd/i386/syscallent.h
freebsd/syscalls.pl
linux/s390/syscallent.h
linux/s390x/syscallent.h
svr4/syscallent.h
syscall.c
syscallent.sh