From b33585f47982d7e01f248236de01e02b0dac3a78 Mon Sep 17 00:00:00 2001 From: Cra3z Date: Fri, 20 Nov 2026 17:55:38 +0800 Subject: [PATCH] Handle interrupted writes in `try_wakeup` by retrying on `EINTR` Co-authored-by: 3453-315h <10131815+3453-315h@users.noreply.github.com> --- include/exec/linux/io_uring_context.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/exec/linux/io_uring_context.hpp b/include/exec/linux/io_uring_context.hpp index 2f819710e..bbb9929fc 100644 --- a/include/exec/linux/io_uring_context.hpp +++ b/include/exec/linux/io_uring_context.hpp @@ -413,7 +413,13 @@ namespace experimental::execution auto try_wakeup() noexcept -> std::error_code { std::uint64_t __wakeup = 1; - if (::write(__eventfd_, &__wakeup, sizeof(__wakeup)) == -1) + ssize_t __ret; + do + { + __ret = ::write(__eventfd_, &__wakeup, sizeof(__wakeup)); + } + while (__ret == -1 && errno == EINTR); + if (__ret == -1) { return {errno, std::system_category()}; }