mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
Kernel: Add support for MSG_NOSIGNAL and properly send SIGPIPE
Previously we didn't send the SIGPIPE signal to processes when sendto()/sendmsg()/etc. returned EPIPE. And now we do. This also adds support for MSG_NOSIGNAL to suppress the signal.
This commit is contained in:
parent
e5e7ea90b1
commit
ce4b66e908
4 changed files with 16 additions and 5 deletions
|
@ -120,10 +120,8 @@ ErrorOr<size_t> FIFO::read(OpenFileDescription& fd, u64, UserOrKernelBuffer& buf
|
|||
|
||||
ErrorOr<size_t> FIFO::write(OpenFileDescription& fd, u64, UserOrKernelBuffer const& buffer, size_t size)
|
||||
{
|
||||
if (!m_readers) {
|
||||
Thread::current()->send_signal(SIGPIPE, &Process::current());
|
||||
if (!m_readers)
|
||||
return EPIPE;
|
||||
}
|
||||
if (!fd.is_blocking() && m_buffer->space_for_writing() == 0)
|
||||
return EAGAIN;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue