2021-12-06 17:11:05 +00:00
|
|
|
/*
|
2024-10-04 11:19:50 +00:00
|
|
|
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
|
2021-12-06 17:11:05 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-01-14 13:12:49 +00:00
|
|
|
#include <LibCore/System.h>
|
2022-01-15 11:56:48 +00:00
|
|
|
#include <LibCore/SystemServerTakeover.h>
|
2022-02-25 10:18:30 +00:00
|
|
|
#include <LibIPC/ConnectionFromClient.h>
|
2021-12-06 17:11:05 +00:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
2022-02-25 10:18:30 +00:00
|
|
|
template<typename ConnectionFromClientType>
|
|
|
|
ErrorOr<NonnullRefPtr<ConnectionFromClientType>> take_over_accepted_client_from_system_server()
|
2021-12-06 17:11:05 +00:00
|
|
|
{
|
2022-01-15 11:56:48 +00:00
|
|
|
auto socket = TRY(Core::take_over_socket_from_system_server());
|
2024-10-22 21:47:33 +00:00
|
|
|
return IPC::new_client_connection<ConnectionFromClientType>(IPC::Transport(move(socket)));
|
2021-12-06 17:11:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|