main.cpp 749 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include "ClientConnection.h"
  7. #include <LibCore/EventLoop.h>
  8. #include <LibCore/LocalServer.h>
  9. #include <LibCore/System.h>
  10. #include <LibIPC/ClientConnection.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 socket = TRY(Core::LocalSocket::take_over_accepted_socket_from_system_server());
  17. (void)IPC::new_client_connection<LanguageServers::Shell::ClientConnection>(move(socket), 1);
  18. TRY(Core::System::pledge("stdio rpath recvfd"));
  19. TRY(Core::System::unveil("/etc/passwd", "r"));
  20. return event_loop.exec();
  21. }