[PATCH] tests: add test for P_PGID in waitid

SuHsueyu anolasc13 at gmail.com
Mon Mar 14 10:30:44 UTC 2022


---
GSoC micro project. This patch try to cover the P_PGID in waitid.

 tests/waitid.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/waitid.c b/tests/waitid.c
index a14899530..2ca81e921 100644
--- a/tests/waitid.c
+++ b/tests/waitid.c
@@ -236,10 +236,17 @@ main(void)
 	tprintf("waitid(P_PID, %d, %s, WEXITED, %s) = 0\n",
 		pid, sprint_siginfo(sinfo, "0"), sprint_rusage(rusage));
 
+	pid_t pgid = getpgid(pid);
+	long pgrc = do_waitid(P_PGID, pgid, sinfo, WEXITED, rusage);
+	tprintf("waitid(P_PGID, %d, %p, WEXITED, %p)"
+		" = %ld %s (%m)\n", pgid, sinfo, rusage, pgrc, errno2name());
+
 	long rc = do_waitid(P_ALL, -1, sinfo, WEXITED|WSTOPPED, rusage);
 	tprintf("waitid(P_ALL, -1, %p, WEXITED|WSTOPPED, %p)"
 		" = %ld %s (%m)\n", sinfo, rusage, rc, errno2name());
 
+	
+
 	tprintf("%s\n", "+++ exited with 0 +++");
 	return 0;
 }
-- 
2.25.1



More information about the Strace-devel mailing list