[LTP] openposix: timers/twoevtimers: Wait for both timer signals
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Fri Oct 9 12:09:22 CEST 2026
Hi Jan,
On 9 Oct 2026, Jan Stancek wrote:
> openposix: timers/twoevtimers: Wait for both timer signals
> + while (left > 0 && !(caughtalarm && caughtabort))
> + left = sleep(left);
On glibc and musl, sleep() discards the fractional remaining time.
If the first signal interrupts sleep(3) after 2.1 seconds, it returns
zero with about 0.9 seconds still in the budget, so this can fail before
the second signal arrives.
Use nanosleep() and retain the full remaining timespec, or wait against
a monotonic deadline.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list