Kernel/LibC: Implement basic socket binding

This commit is contained in:
2024-02-02 01:31:58 +02:00
parent cf28ecd5a6
commit ab150b458a
13 changed files with 119 additions and 7 deletions

View File

@@ -56,6 +56,12 @@ namespace Kernel
return true;
}
void Inode::on_close()
{
LockGuard _(m_lock);
on_close_impl();
}
BAN::ErrorOr<BAN::RefPtr<Inode>> Inode::find_inode(BAN::StringView name)
{
LockGuard _(m_lock);
@@ -110,6 +116,14 @@ namespace Kernel
return link_target_impl();
}
BAN::ErrorOr<void> Inode::bind(const sockaddr* address, socklen_t address_len)
{
LockGuard _(m_lock);
if (!mode().ifsock())
return BAN::Error::from_errno(ENOTSOCK);
return bind_impl(address, address_len);
}
BAN::ErrorOr<size_t> Inode::read(off_t offset, BAN::ByteSpan buffer)
{
LockGuard _(m_lock);