1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Kernel+LibC: Implement the socketpair() syscall

This commit is contained in:
Gunnar Beutner 2021-04-28 12:39:12 +02:00 committed by Andreas Kling
parent c841012f56
commit aa792062cb
11 changed files with 100 additions and 91 deletions

View file

@ -14,12 +14,18 @@ namespace Kernel {
class FileDescription;
struct SocketPair {
NonnullRefPtr<FileDescription> description1;
NonnullRefPtr<FileDescription> description2;
};
class LocalSocket final : public Socket
, public InlineLinkedListNode<LocalSocket> {
friend class InlineLinkedListNode<LocalSocket>;
public:
static KResultOr<NonnullRefPtr<Socket>> create(int type);
static KResultOr<SocketPair> create_connected_pair(int type);
virtual ~LocalSocket() override;
KResult sendfd(const FileDescription& socket_description, FileDescription& passing_description);