1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

Kernel: Begin implementing UNIX domain sockets.

This commit is contained in:
Andreas Kling 2019-02-14 14:17:38 +01:00
parent dc200923f2
commit 2f35e54f80
12 changed files with 177 additions and 1 deletions

29
Kernel/Socket.cpp Normal file
View file

@ -0,0 +1,29 @@
#include <Kernel/Socket.h>
#include <Kernel/LocalSocket.h>
#include <Kernel/UnixTypes.h>
#include <LibC/errno_numbers.h>
RetainPtr<Socket> Socket::create(int domain, int type, int protocol, int& error)
{
(void)protocol;
switch (domain) {
case AF_LOCAL:
return LocalSocket::create(type);
default:
error = EAFNOSUPPORT;
return nullptr;
}
}
Socket::Socket(int domain, int type, int protocol)
: m_domain(domain)
, m_type(type)
, m_protocol(protocol)
{
}
Socket::~Socket()
{
}