main.cpp 685 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "ConnectionFromClient.h"
  7. #include <LibCore/EventLoop.h>
  8. #include <LibCore/LocalServer.h>
  9. #include <LibCore/System.h>
  10. #include <LibIPC/SingleServer.h>
  11. #include <LibMain/Main.h>
  12. ErrorOr<int> serenity_main(Main::Arguments)
  13. {
  14. Core::EventLoop event_loop;
  15. TRY(Core::System::pledge("stdio unix rpath recvfd"));
  16. auto client = TRY(IPC::take_over_accepted_client_from_system_server<LanguageServers::Shell::ConnectionFromClient>());
  17. TRY(Core::System::pledge("stdio rpath recvfd"));
  18. TRY(Core::System::unveil("/etc/passwd", "r"));
  19. return event_loop.exec();
  20. }