diff mbox series

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

Message ID 20231002183550.1351704-1-edliaw@google.com
State Changes Requested
Headers show
Series [v2] getpgid01: On Android, pgid(1) is 0 instead of 1 | expand

Commit Message

Edward Liaw Oct. 2, 2023, 6:35 p.m. UTC
From: Edward Liaw via ltp <ltp@lists.linux.it>

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 | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Petr Vorel Oct. 26, 2023, 10:05 a.m. UTC | #1
Hi Edward,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/getpgid/getpgid01.c b/testcases/kernel/syscalls/getpgid/getpgid01.c
index 479fe5dcb..5523101e7 100644
--- a/testcases/kernel/syscalls/getpgid/getpgid01.c
+++ b/testcases/kernel/syscalls/getpgid/getpgid01.c
@@ -37,7 +37,11 @@  static void run(void)
 		TST_EXP_EQ_LI(TST_RET, pgid);
 
 		TST_EXP_PID(getpgid(1));
+#ifndef __ANDROID__
 		TST_EXP_EQ_LI(TST_RET, 1);
+#else
+		TST_EXP_EQ_LI(TST_RET, 0);
+#endif
 	}
 
 	tst_reap_children();