From df82a2db4b823162c00ce2d788a1b213bb9191f6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 31 Jan 2023 14:38:03 +0100 Subject: ptrace-waitpid: update --- _posts/2022-11-07-ptrace-waitpid.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_posts/2022-11-07-ptrace-waitpid.md b/_posts/2022-11-07-ptrace-waitpid.md index 3c331c7..b5f34fa 100644 --- a/_posts/2022-11-07-ptrace-waitpid.md +++ b/_posts/2022-11-07-ptrace-waitpid.md @@ -36,6 +36,8 @@ status changes from other thread's children. So if you have two tracer threads A and B, and each of them is attached to a tracee, then thread A might consume thread B's tracee status change by calling `waitpid(-1)`. +Therefore, thread A would have thread B's tracee status. +A typical application could be completely unprepared for this scenario. To avoid that, use the `__WNOTHREAD` flag. That way, thread A will only consume status changes from its own children only. -- cgit v1.2.3