mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
Kernel: read()/write() should respect timeouts when used on a sockets
Move timeout management to the ReadBlocker and WriteBlocker classes. Also get rid of the specialized ReceiveBlocker since it no longer does anything that ReadBlocker can't do.
This commit is contained in:
@@ -1658,6 +1658,8 @@ ssize_t Process::sys$read(int fd, u8* buffer, ssize_t size)
|
||||
if (!description->can_read()) {
|
||||
if (current->block<Thread::ReadBlocker>(*description) != Thread::BlockResult::WokeNormally)
|
||||
return -EINTR;
|
||||
if (!description->can_read())
|
||||
return -EAGAIN;
|
||||
}
|
||||
}
|
||||
return description->read(buffer, size);
|
||||
|
||||
Reference in New Issue
Block a user