axboe / liburing

Library providing helpers for the Linux kernel io_uring support
MIT License
2.77k stars 398 forks source link

Are read, write, recv, and send functions not expected to return EINTR? #1042

Closed sxstd001 closed 5 months ago

sxstd001 commented 7 months ago

Are read, write, recv, and send functions not expected to return EINTR? Because uring is non-blocking;

This code is right? only ERR_AGAIN try again;

        async<int> writeAll(const void *buf, u32 count){
            again:
            auto ret = co_await event::prepSend(fd, buf, count, 0); //  call: io_uring_prep_send
            if(ret >= 0) {
                         assert(ret == count || ret == 0);
                             co_return ret; 
                         }
            if(ret == -ERR_AGAIN )goto again;
                        co_return ret;
        }