public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH 0/1] brk: use direct syscalls
Date: Tue, 29 Nov 2022 14:36:42 +0100	[thread overview]
Message-ID: <Y4YK6uhK94C0vrVR@pevik> (raw)
In-Reply-To: <Y4YEnmDLD7AEMHrr@yuki>

> Hi!
> > void verify_brk(void)
> > {
> > 	if (tst_variant) {
> > 		tst_res(TINFO, "Testing sbrk()");
> > 		cur_brk = (uintptr_t)sbrk(0);
> > 	} else {
> > 		tst_res(TINFO, "Testing __NR_brk");
> > 		cur_brk = (void *)tst_syscall(__NR_brk, 0);
> > 	}

> > }

> > struct tst_test test = {
> > 	...
> > #ifdef __GLIBC__
> > 	.test_variants = 2,
> > #else
> > 	.test_variants = 1,
> > #endif
> > 	...

> > Not sure if it should be testeed also on android, i.e:
> > #if defined(__GLIBC__) || defined(__ANDROID__)

> Can we rather than ifdefing things out check the actual return values?

> Should be as easy as doing:

> 	if (cur_brk == (void*)-1)
> 		tst_brk(TCONF, "sbrk() not implemented");

> in the libc test variant.

+1.

WDYT about .test_variants? In that case it'd be tested also on musl
or any platform where it's implemented.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2022-11-29 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28  9:15 [LTP] [RFC PATCH 0/1] brk: use direct syscalls Teo Couprie Diaz
2022-11-28  9:15 ` [LTP] [RFC PATCH 1/1] syscalls/brk: use direct syscall Teo Couprie Diaz
2022-11-28 19:30 ` [LTP] [RFC PATCH 0/1] brk: use direct syscalls Petr Vorel
2022-11-29 13:09   ` Cyril Hrubis
2022-11-29 13:36     ` Petr Vorel [this message]
2022-11-29 13:40       ` Cyril Hrubis
2022-11-30 13:03         ` Teo Couprie Diaz
2022-11-30 13:15           ` Cyril Hrubis
2022-11-30 14:22             ` Teo Couprie Diaz
2022-11-30 12:49   ` Teo Couprie Diaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4YK6uhK94C0vrVR@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox