Skip to contentSkip to conversation

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

PATCH Superseded Edward Liaw via ltp 2 participants 2 messages Oct 2, 2023 – Oct 26, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 getpgid01: On Android, pgid(1) is 0 instead of 1

From: Edward Liaw via ltp <[email protected]>

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.

---
 testcases/kernel/syscalls/getpgid/getpgid01.c | 4 ++++
 1 file changed, 4 insertions(+)
testcases/kernel/syscalls/getpgid/getpgid01.c +4 -0
index 479fe5dcb..5523101e7 100644
@@ -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();
Signature · 5 lines
2.42.0.582.g8ccd20d70d-goog


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