2020-09-20 14:55:36 -03:00
|
|
|
/*
|
2021-02-06 10:58:02 -03:00
|
|
|
* Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
|
2020-09-20 14:55:36 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-09-20 14:55:36 -03:00
|
|
|
*/
|
|
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
#include "ConnectionFromClient.h"
|
2021-05-12 14:36:00 -03:00
|
|
|
#include <LibCore/ArgsParser.h>
|
2020-09-28 10:37:37 -03:00
|
|
|
#include <LibCore/EventLoop.h>
|
|
|
|
|
#include <LibCore/LocalServer.h>
|
2021-11-23 06:59:50 -03:00
|
|
|
#include <LibCore/System.h>
|
2021-12-06 14:11:05 -03:00
|
|
|
#include <LibIPC/SingleServer.h>
|
2021-11-23 06:36:29 -03:00
|
|
|
#include <LibMain/Main.h>
|
2020-09-20 14:55:36 -03:00
|
|
|
|
2022-05-14 11:09:24 -03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2020-09-28 10:37:37 -03:00
|
|
|
{
|
|
|
|
|
Core::EventLoop event_loop;
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio unix recvfd rpath"));
|
2020-09-20 14:55:36 -03:00
|
|
|
|
2022-02-25 07:18:30 -03:00
|
|
|
auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Cpp::ConnectionFromClient>());
|
2021-11-23 06:36:29 -03:00
|
|
|
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio recvfd rpath"));
|
2021-11-23 06:59:50 -03:00
|
|
|
TRY(Core::System::unveil("/usr/include", "r"));
|
2021-02-06 10:58:02 -03:00
|
|
|
|
|
|
|
|
// unveil will be sealed later, when we know the project's root path.
|
2020-09-28 10:37:37 -03:00
|
|
|
return event_loop.exec();
|
|
|
|
|
}
|