[LTP] [PATCH] syscall02: add invalid syscall number test

Petr Vorel pvorel@suse.cz
Tue Jun 30 18:40:46 CEST 2026


Hi Andrea,

> Hi Petr,

> > > I suggest add two more cases check:
> > > 1) -1
> > > 2) __NR_syscalls +1 (Base arch/powerpc/kernel/syscall.c)


> that was my initial idea, but different architectures are starting
> from a different value and I wanted to make it generic. I guess
> the right way would be to include syscalls.h and use
> __LTP__NR_INVALID_SYSCALL at this point. WDYT?

Yes, __LTP__NR_INVALID_SYSCALL is better than -1 (for all archs we have
#define __LTP__NR_INVALID_SYSCALL -1)

But I'd also use __NR_syscalls from <asm-generic/unistd.h> (the second suggested
case), i.e. have arch dependent value based on UAPI headers.

Also, you could add a real description to the values to .desc.

Kind regards,
Petr


More information about the ltp mailing list