diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-01-31 14:38:03 +0100 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-01-31 14:38:03 +0100 |
commit | df82a2db4b823162c00ce2d788a1b213bb9191f6 (patch) | |
tree | 2a4f1bcac773d6da83a90f2fbb3edc4f82a51e78 | |
parent | workflows/jekyll: upgrade actions (diff) | |
download | blog-df82a2db4b823162c00ce2d788a1b213bb9191f6.tar.gz blog-df82a2db4b823162c00ce2d788a1b213bb9191f6.zip |
ptrace-waitpid: update
Diffstat (limited to '')
-rw-r--r-- | _posts/2022-11-07-ptrace-waitpid.md | 2 |
1 files changed, 2 insertions, 0 deletions
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. |