public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Edward Liaw <edliaw@google.com>
Cc: kernel-team@android.com, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] getpgid01: On Android, pgid(1) is 0 instead of 1
Date: Sat, 30 Sep 2023 08:54:43 +0200	[thread overview]
Message-ID: <20230930065443.GC414289@pevik> (raw)
In-Reply-To: <20230930000516.4063681-1-edliaw@google.com>

Hi Edward,

> Android's init does not call setpgid(0, 0) so it does not have pgid=1.
> 0 is functionally equivalent, since pgid 0 means the pgid is the same as
> the process pid.

> Signed-off-by: Edward Liaw <edliaw@google.com>
> ---
>  testcases/kernel/syscalls/getpgid/getpgid01.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/kernel/syscalls/getpgid/getpgid01.c b/testcases/kernel/syscalls/getpgid/getpgid01.c
> index 479fe5dcb..8640f2c93 100644
> --- a/testcases/kernel/syscalls/getpgid/getpgid01.c
> +++ b/testcases/kernel/syscalls/getpgid/getpgid01.c
> @@ -37,7 +37,7 @@ static void run(void)
>  		TST_EXP_EQ_LI(TST_RET, pgid);

>  		TST_EXP_PID(getpgid(1));
> -		TST_EXP_EQ_LI(TST_RET, 1);
> +		TST_EXP_EXPR(TST_RET == 1 || TST_RET == 0, "getpgid(1) == 1 or 0");
Although I don't prefer using often libc specific code, here I'd use it:

#ifndef __ANDROID__ 
		TST_EXP_EQ_LI(TST_RET, 0);
#else
		TST_EXP_EQ_LI(TST_RET, 1);
#endif

Because your code would loosen testing for other libc.
Cyril, Li, WDYT?

Kind regards,
Petr

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

  reply	other threads:[~2023-09-30  6:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-30  0:05 [LTP] [PATCH] getpgid01: On Android, pgid(1) is 0 instead of 1 Edward Liaw via ltp
2023-09-30  6:54 ` Petr Vorel [this message]
2023-10-02 17:49   ` Edward Liaw via ltp
2023-10-26 11:11   ` Cyril Hrubis
2023-10-26 11:40     ` Petr Vorel

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=20230930065443.GC414289@pevik \
    --to=pvorel@suse.cz \
    --cc=edliaw@google.com \
    --cc=kernel-team@android.com \
    --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