llvm-project
fda4724c - [libc] Fix WIFSIGNALED and WIFSTOPPED for stopped and continued children (#235759)

Commit
4 days ago
[libc] Fix WIFSIGNALED and WIFSTOPPED for stopped and continued children (#235759) WIFSIGNALED treated any non-zero termination signal as a signal, so it was also true for a stopped child, whose low byte is 0x7f, and for a continued one (0xffff). WIFSTOPPED masked with 0x7f instead of 0xff, so it was also true for a continued child. Make each macro true for exactly one kind of status, as glibc and musl do, and add tests for exited, signalled, stopped and continued statuses. AI disclosure: this patch was written with Claude Code. I reviewed the change and ran the new test; it fails without the fix and passes with it. Assisted-by: Claude
Author
Parents
Loading