Kernel/LibC: Implement super basic select

This does not really even block but it works... :D
This commit is contained in:
2024-02-12 17:26:33 +02:00
parent f50b4be162
commit 3fc1edede0
34 changed files with 285 additions and 41 deletions

View File

@@ -248,6 +248,29 @@ namespace Kernel
return {};
}
bool UnixDomainSocket::can_read_impl() const
{
if (m_info.has<ConnectionInfo>())
{
auto& connection_info = m_info.get<ConnectionInfo>();
if (!connection_info.connection)
return false;
}
return m_packet_size_total > 0;
}
bool UnixDomainSocket::can_write_impl() const
{
if (m_info.has<ConnectionInfo>())
{
auto& connection_info = m_info.get<ConnectionInfo>();
return connection_info.connection.valid();
}
return true;
}
BAN::ErrorOr<size_t> UnixDomainSocket::sendto_impl(BAN::ConstByteSpan message, const sockaddr* address, socklen_t address_len)
{
if (message.size() > s_packet_buffer_size)