[LTP] [PATCH v2] getrlimit/getrlimit03: Skip test if __NR_getrlimit_ulong not implemented

Tiezhu Yang yangtiezhu@loongson.cn
Wed Jul 9 03:42:03 CEST 2025


On 2025/7/8 下午9:10, Li Wang wrote:
> 
> 
> On Tue, Jul 8, 2025 at 7:28 PM Tiezhu Yang <yangtiezhu@loongson.cn 
> <mailto:yangtiezhu@loongson.cn>> wrote:
> 
>     In the LTP code, __NR_getrlimit_ulong is defined as __NR_ugetrlimit
>     or __NR_getrlimit.
> 
>     In the Linux kernel, LoongArch uses the generic syscall table
>     which is defined in include/uapi/asm-generic/unistd.h. We can
>     see that __NR_ugetrlimit is not defined in the generic header,
>     and also there is no __ARCH_WANT_SET_GET_RLIMIT definition in
>     the arch specific header arch/loongarch/include/asm/unistd.h,
>     so both __NR_ugetrlimit and __NR_getrlimit are not implemented
>     on LoongArch.
> 
>     That is to say, no need to compare the return value and errno
>     about the syscall numbers __NR_prlimit64 and __NR_{u}getrlimit,
>     just check this case and then skip the test.
> 
>     While at it, modify the value of test.tcnt as 1 to skip only
>     once if the errno of getrlimit_ulong() or getrlimit_long() is
>     ENOSYS.

...

>     @@ -181,6 +187,7 @@ static void run(unsigned int resource)
>              if (errno_l == ENOSYS) {
>                      tst_res(TCONF | TERRNO,
>                              "__NR_getrlimit(%d) not implemented",
>     __NR_getrlimit);
> 
>     +               test.tcnt = 1;
> 
> 
> This second test.tcnt resetting is redundant, if the SIGNED_GETRLIMIT
> get defined, that means both __NR_getrlimit and __NR_ugetrlimit are 
> detected,
> and the only negative situation is getrlimit_ulong(resource, &rlim_ul);
> works well, but getrlimit_long(resource, &rlim_l); return ENOSYS, to 
> make the
> test can be interaction the second should no test.tcnt = 1.
> 
> See: 
> https://github.com/linux-test-project/ltp/commit/fac783b5d6631efa70d2ea3257142763d944ba32
> 
> Anyway, I modified the patch and merged!

Thank you. If so, it is better to remove "or getrlimit_long()" in the
commit message to reflect the reality, like this:

"While at it, modify the value of test.tcnt as 1 to skip only
once if the errno of getrlimit_ulong() is ENOSYS."

If possible, git commit --amend and git push --force can make the log
more clear.

Thanks,
Tiezhu



More information about the ltp mailing list