[LTP] [PATCH] getpgid01: On Android, pgid(1) is 0 instead of 1

Petr Vorel pvorel@suse.cz
Thu Oct 26 13:40:52 CEST 2023


Hi,

...
> > #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?

> @Peter what about the case where we bypass all init and boot with
> init=/bin/sh or init=ltx? I suppose that we will have pgrp set to 0
> as well.

Ah, so v1 version was better, right?

> What about parsing /proc/1/stat and checking that the value there is the
> same as reported here, that should work regardless of what pid is the
> init.

That sounds best to me. I'm sorry Edward, could you please send v3?

Kind regards,
Petr


More information about the ltp mailing list