mirror of
https://github.com/RGBCube/serenity
synced 2025-07-01 03:32:12 +00:00
Kernel: Check can_write for blocking write
This way the socket write buffer sizes are respected, and things that exceed them get sent EAGAIN.
This commit is contained in:
parent
635eb20289
commit
d8b74c8c86
1 changed files with 4 additions and 2 deletions
|
@ -853,8 +853,10 @@ ssize_t Process::sys$writev(int fd, const struct iovec* iov, int iov_count)
|
|||
ssize_t Process::do_write(FileDescriptor& descriptor, const byte* data, int data_size)
|
||||
{
|
||||
ssize_t nwritten = 0;
|
||||
if (!descriptor.is_blocking())
|
||||
return descriptor.write(data, data_size);
|
||||
if (!descriptor.is_blocking()) {
|
||||
if (!descriptor.can_write())
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
while (nwritten < data_size) {
|
||||
#ifdef IO_DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue