Kernel: Fix how socket closing works

Sockets are now closed only when they are not referenced any more. This
allows child process to close socket and still keep it open for the
parent.
This commit is contained in:
2024-06-19 10:39:44 +03:00
parent d5daa46ab8
commit bce16cdd6e
9 changed files with 50 additions and 55 deletions

View File

@@ -86,8 +86,6 @@ namespace Kernel
virtual bool is_pipe() const { return false; }
virtual bool is_tty() const { return false; }
void on_close();
// Directory API
BAN::ErrorOr<BAN::RefPtr<Inode>> find_inode(BAN::StringView);
BAN::ErrorOr<size_t> list_next_inodes(off_t, struct dirent* list, size_t list_size);
@@ -122,8 +120,6 @@ namespace Kernel
BAN::ErrorOr<long> ioctl(int request, void* arg);
protected:
virtual void on_close_impl() {}
// Directory API
virtual BAN::ErrorOr<BAN::RefPtr<Inode>> find_inode_impl(BAN::StringView) { return BAN::Error::from_errno(ENOTSUP); }
virtual BAN::ErrorOr<size_t> list_next_inodes_impl(off_t, struct dirent*, size_t) { return BAN::Error::from_errno(ENOTSUP); }