[LTP] [PATCH V4 06/17] syscalls/futex: Add support for time64 tests
Li Wang
liwang@redhat.com
Tue Jun 9 14:55:49 CEST 2020
On Fri, May 22, 2020 at 6:53 PM Viresh Kumar <viresh.kumar@linaro.org>
wrote:
> ...
> diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c
> b/testcases/kernel/syscalls/futex/futex_wake04.c
> index f92bda53f6c7..edbb9c644c57 100644
> --- a/testcases/kernel/syscalls/futex/futex_wake04.c
> +++ b/testcases/kernel/syscalls/futex/futex_wake04.c
> ...
>
> static void wakeup_thread2(void)
> {
> + struct test_variants *tv = &variants[tst_variant];
> void *addr;
> int hpsz, pgsz, res;
> pthread_t th1, th2;
>
> hpsz = read_hugepagesize();
> - tst_resm(TINFO, "Hugepagesize %i", hpsz);
> + tst_res(TINFO, "Hugepagesize %i", hpsz);
>
> /*allocate some shared memory*/
> addr = mmap(NULL, hpsz, PROT_WRITE | PROT_READ,
> MAP_SHARED | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0);
>
> if (addr == MAP_FAILED) {
> - if (errno == ENOMEM) {
> - tst_brkm(TCONF, NULL,
> - "Cannot allocate hugepage, memory too
> fragmented?");
> - }
> + if (errno == ENOMEM)
> + tst_res(TCONF, "Cannot allocate hugepage, memory
> too fragmented?");
>
Here we can use tst_brk(TCONF, ...), otherwise, the if condition will out
of action for ENOMEM.
- tst_brkm(TBROK | TERRNO, NULL, "Cannot allocate hugepage");
> + tst_res(TFAIL | TERRNO, "Cannot allocate hugepage");
> + return;
>
tst_brk(TBROK | TERRNO, ...)
--
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20200609/cd003ff1/attachment.htm>
More information about the ltp
mailing list