mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-04-25 14:04:02 +00:00
Kernel: Begin implementing UNIX domain sockets.
This commit is contained in:
29
Kernel/Socket.cpp
Normal file
29
Kernel/Socket.cpp
Normal 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()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user