summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIPC/SingleServer.h
blob: 36477ae40a754e362d992a5562120d3980454d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibIPC/ClientConnection.h>

namespace IPC {

template<typename ClientConnectionType>
ErrorOr<NonnullRefPtr<ClientConnectionType>> take_over_accepted_client_from_system_server()
{
    auto socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
    return IPC::new_client_connection<ClientConnectionType>(move(socket));
}

}