Kernel: Unix domain sockets close can now be detected

When a unix domain socket is closed and it has a connection to another
socket, it will make the other socket readable and recv will return 0.

This allows detection of socket closing
This commit is contained in:
2024-06-02 16:48:55 +03:00
parent f12ffa92a0
commit 446220494e
2 changed files with 13 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ namespace Kernel
{
bool listening { false };
BAN::Atomic<bool> connection_done { false };
mutable BAN::Atomic<bool> target_closed { false };
BAN::WeakPtr<UnixDomainSocket> connection;
BAN::Queue<BAN::RefPtr<UnixDomainSocket>> pending_connections;
Semaphore pending_semaphore;