main.cpp 796 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2021, Itamar S. <itamar8910@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "ConnectionFromClient.h"
  7. #include <LibCore/ArgsParser.h>
  8. #include <LibCore/EventLoop.h>
  9. #include <LibCore/LocalServer.h>
  10. #include <LibCore/System.h>
  11. #include <LibIPC/SingleServer.h>
  12. #include <LibMain/Main.h>
  13. ErrorOr<int> serenity_main(Main::Arguments)
  14. {
  15. Core::EventLoop event_loop;
  16. TRY(Core::System::pledge("stdio unix recvfd rpath"));
  17. auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Cpp::ConnectionFromClient>());
  18. TRY(Core::System::pledge("stdio recvfd rpath"));
  19. TRY(Core::System::unveil("/usr/include", "r"));
  20. // unveil will be sealed later, when we know the project's root path.
  21. return event_loop.exec();
  22. }